From 0d0e3289698739aa921fb4cae0992553fb0e90ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A2=9C=E6=B4=AA=E6=AF=85?= Date: Fri, 12 May 2023 15:22:50 +0800 Subject: [PATCH] maven --- router-annotation/build.gradle | 8 ++++++-- router-compiler/build.gradle | 9 ++++++--- router/build.gradle | 18 ++++++++++++++++-- settings.gradle | 2 ++ 4 files changed, 30 insertions(+), 7 deletions(-) diff --git a/router-annotation/build.gradle b/router-annotation/build.gradle index 22a1948..1ab29a4 100644 --- a/router-annotation/build.gradle +++ b/router-annotation/build.gradle @@ -17,14 +17,18 @@ tasks.withType(JavaCompile) { publishing { publications { - maven(MavenPublication) { + release(MavenPublication) { groupId = "${group}" - artifactId = "router-annotation" + artifactId = "${project.name}" version = "2.0.6" + afterEvaluate { + from components.java + } } } // 发布的仓库配置 repositories { + mavenLocal() maven { url "https://jitpack.io" } diff --git a/router-compiler/build.gradle b/router-compiler/build.gradle index 0d627d6..3d082bb 100644 --- a/router-compiler/build.gradle +++ b/router-compiler/build.gradle @@ -25,17 +25,20 @@ tasks.withType(JavaCompile) { publishing { publications { - maven(MavenPublication) { + release(MavenPublication) { groupId = "${group}" - artifactId = "router-compiler" + artifactId = "${project.name}" version = "2.0.6" + afterEvaluate { + from components.java + } } } // 发布的仓库配置 repositories { + mavenLocal() maven { url "https://jitpack.io" } } } - diff --git a/router/build.gradle b/router/build.gradle index a44bf65..a50b19b 100644 --- a/router/build.gradle +++ b/router/build.gradle @@ -27,10 +27,15 @@ android { sourceCompatibility JavaVersion.VERSION_17 targetCompatibility JavaVersion.VERSION_17 } + lint { abortOnError false checkReleaseBuilds false } + + publishing { + singleVariant("release") + } } dependencies { @@ -50,16 +55,25 @@ tasks.withType(JavaCompile) { options.encoding = "UTF-8" } +task generateSourcesJar(type: Jar) { + from android.sourceSets.main + archiveClassifier = 'sources' +} + publishing { publications { - maven(MavenPublication) { + release(MavenPublication) { groupId = "${group}" - artifactId = "router" + artifactId = "${project.name}" version = "2.0.6" + afterEvaluate { + from components.release + } } } // 发布的仓库配置 repositories { + mavenLocal() maven { url "https://jitpack.io" } diff --git a/settings.gradle b/settings.gradle index 05dc46f..aab65a9 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,5 +1,6 @@ pluginManagement { repositories { + mavenLocal() maven { url 'https://jitpack.io' } maven { url "https://maven.aliyun.com/repository/public" } mavenCentral() @@ -11,6 +12,7 @@ pluginManagement { dependencyResolutionManagement { repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) repositories { + mavenLocal() maven { url 'https://jitpack.io' } maven { url "https://maven.aliyun.com/repository/public" } mavenCentral()