From 8c1a235136026faf118129905e9c700fabd195fd Mon Sep 17 00:00:00 2001 From: atavism Date: Tue, 21 Jan 2025 20:52:47 -0800 Subject: [PATCH] update gradle version --- Makefile | 6 ++---- build/.gitkeep | 0 example/build.gradle | 2 +- gradle/wrapper/gradle-wrapper.properties | 2 +- gradlew | 3 +-- sdk/build.gradle | 23 +++++++++++++++++++++++ 6 files changed, 28 insertions(+), 8 deletions(-) delete mode 100644 build/.gitkeep diff --git a/Makefile b/Makefile index 07ed173..732ddcc 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ SDK_NAME := liblantern SDK_DIR := sdk AAR_OUTPUT := lanternsdk-android.aar -SDK_OUTPUT := sdk-debug.aar +SDK_OUTPUT := sdk-release.aar LIBS_DIR := $(SDK_DIR)/libs BUILD_DIR := build PROD_FLAG := -ldflags "-s -w" @@ -30,13 +30,11 @@ copy-aar: build: build-aar copy-aar # Build SDK -release: build sdk-debug copy-sdk +release: build sdk-release copy-sdk @echo "Building SDK.." $(GRADLEW) assembleRelease copy-sdk: - ls build/sdk/outputs - ls build/sdk/outputs/aar cp build/sdk/outputs/aar/$(SDK_OUTPUT) example/libs sdk-debug: diff --git a/build/.gitkeep b/build/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/example/build.gradle b/example/build.gradle index 5b8129b..ef2087a 100644 --- a/example/build.gradle +++ b/example/build.gradle @@ -56,7 +56,7 @@ repositories { dependencies { //implementation project(':sdk') - implementation files('libs/sdk-debug.aar') + implementation files('libs/sdk-release.aar') coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.3' implementation fileTree(dir: "libs", include: ["*.jar"]) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 94113f2..cea7a79 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index f5feea6..f3b75f3 100755 --- a/gradlew +++ b/gradlew @@ -86,8 +86,7 @@ done # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s -' "$PWD" ) || exit +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum diff --git a/sdk/build.gradle b/sdk/build.gradle index b090a3c..605aa90 100644 --- a/sdk/build.gradle +++ b/sdk/build.gradle @@ -1,6 +1,8 @@ plugins { id 'com.android.library' id 'kotlin-android' + id 'maven-publish' + id 'signing' } apply plugin: 'com.kezong.fat-aar' @@ -65,7 +67,28 @@ android { } } +publishing { + publications { + release(MavenPublication) { + groupId = 'org.getlantern.lantern' + artifactId = 'sdk' + version = '1.0.0' + } + } + + repositories { + maven { + name = "ossrh" + url = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/") + + credentials { + username = project.findProperty("mavenCentralUsername") ?: System.getenv("MAVEN_USERNAME") + password = project.findProperty("mavenCentralPassword") ?: System.getenv("MAVEN_PASSWORD") + } + } + } +} dependencies { implementation fileTree(dir: 'libs', include: '*.jar')