Skip to content

Commit 7a554a8

Browse files
committed
build: Fix duplicate publication
KMP already creates one.
1 parent b9bf3bc commit 7a554a8

File tree

1 file changed

+31
-34
lines changed

1 file changed

+31
-34
lines changed

build.gradle.kts

Lines changed: 31 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
2+
13
plugins {
24
alias(libs.plugins.android.library)
35
alias(libs.plugins.binary.compatibility.validator)
@@ -29,18 +31,14 @@ repositories {
2931

3032
kotlin {
3133
jvm {
32-
compilations.all {
33-
kotlinOptions {
34-
jvmTarget = JavaVersion.VERSION_11.toString()
35-
}
34+
compilerOptions {
35+
jvmTarget = JvmTarget.JVM_11
3636
}
3737
}
3838

3939
androidTarget {
40-
compilations.all {
41-
kotlinOptions {
42-
jvmTarget = JavaVersion.VERSION_11.toString()
43-
}
40+
compilerOptions {
41+
jvmTarget = JvmTarget.JVM_11
4442
}
4543

4644
publishLibraryVariants("release")
@@ -98,47 +96,46 @@ publishing {
9896
name = "GitHubPackages"
9997
url = uri("https://maven.pkg.github.com/revanced/revanced-library")
10098
credentials {
101-
username = System.getenv("GITHUB_ACTOR")
102-
password = System.getenv("GITHUB_TOKEN")
99+
username = project.findProperty("gpr.user") as String? ?: System.getenv("GITHUB_ACTOR")
100+
password = project.findProperty("gpr.key") as String? ?: System.getenv("GITHUB_TOKEN")
103101
}
104102
}
105103
}
106104

107-
publications {
108-
create<MavenPublication>("revanced-library-publication") {
109-
version = project.version.toString()
105+
// KMP plugin creates a publication already, so just configure the POM.
106+
publications.all {
107+
if (this !is MavenPublication) return@all
110108

111-
pom {
112-
name = "ReVanced Library"
113-
description = "Library containing common utilities for ReVanced"
114-
url = "https://revanced.app"
109+
pom {
110+
name = "ReVanced Library"
111+
description = "Library containing common utilities for ReVanced"
112+
url = "https://revanced.app"
115113

116-
licenses {
117-
license {
118-
name = "GNU General Public License v3.0"
119-
url = "https://www.gnu.org/licenses/gpl-3.0.en.html"
120-
}
114+
licenses {
115+
license {
116+
name = "GNU General Public License v3.0"
117+
url = "https://www.gnu.org/licenses/gpl-3.0.en.html"
121118
}
119+
}
122120

123-
developers {
124-
developer {
125-
id = "ReVanced"
126-
name = "ReVanced"
127-
128-
}
121+
developers {
122+
developer {
123+
id = "ReVanced"
124+
name = "ReVanced"
125+
129126
}
127+
}
130128

131-
scm {
132-
connection = "scm:git:git://github.com/revanced/revanced-library.git"
133-
developerConnection = "scm:git:[email protected]:revanced/revanced-library.git"
134-
url = "https://github.com/revanced/revanced-library"
135-
}
129+
scm {
130+
connection = "scm:git:git://github.com/revanced/revanced-library.git"
131+
developerConnection = "scm:git:[email protected]:revanced/revanced-library.git"
132+
url = "https://github.com/revanced/revanced-library"
136133
}
137134
}
138135
}
139136
}
140137

141138
signing {
142139
useGpgCmd()
143-
sign(publishing.publications["revanced-library-publication"])
140+
sign(publishing.publications)
144141
}

0 commit comments

Comments
 (0)