|
| 1 | +import org.jetbrains.kotlin.gradle.dsl.JvmTarget |
| 2 | + |
1 | 3 | plugins {
|
2 | 4 | alias(libs.plugins.android.library)
|
3 | 5 | alias(libs.plugins.binary.compatibility.validator)
|
@@ -29,18 +31,14 @@ repositories {
|
29 | 31 |
|
30 | 32 | kotlin {
|
31 | 33 | jvm {
|
32 |
| - compilations.all { |
33 |
| - kotlinOptions { |
34 |
| - jvmTarget = JavaVersion.VERSION_11.toString() |
35 |
| - } |
| 34 | + compilerOptions { |
| 35 | + jvmTarget = JvmTarget.JVM_11 |
36 | 36 | }
|
37 | 37 | }
|
38 | 38 |
|
39 | 39 | androidTarget {
|
40 |
| - compilations.all { |
41 |
| - kotlinOptions { |
42 |
| - jvmTarget = JavaVersion.VERSION_11.toString() |
43 |
| - } |
| 40 | + compilerOptions { |
| 41 | + jvmTarget = JvmTarget.JVM_11 |
44 | 42 | }
|
45 | 43 |
|
46 | 44 | publishLibraryVariants("release")
|
@@ -98,47 +96,46 @@ publishing {
|
98 | 96 | name = "GitHubPackages"
|
99 | 97 | url = uri("https://maven.pkg.github.com/revanced/revanced-library")
|
100 | 98 | 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") |
103 | 101 | }
|
104 | 102 | }
|
105 | 103 | }
|
106 | 104 |
|
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 |
110 | 108 |
|
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" |
115 | 113 |
|
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" |
121 | 118 | }
|
| 119 | + } |
122 | 120 |
|
123 |
| - developers { |
124 |
| - developer { |
125 |
| - id = "ReVanced" |
126 |
| - name = "ReVanced" |
127 |
| - |
128 |
| - } |
| 121 | + developers { |
| 122 | + developer { |
| 123 | + id = "ReVanced" |
| 124 | + name = "ReVanced" |
| 125 | + |
129 | 126 | }
|
| 127 | + } |
130 | 128 |
|
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" |
136 | 133 | }
|
137 | 134 | }
|
138 | 135 | }
|
139 | 136 | }
|
140 | 137 |
|
141 | 138 | signing {
|
142 | 139 | useGpgCmd()
|
143 |
| - sign(publishing.publications["revanced-library-publication"]) |
| 140 | + sign(publishing.publications) |
144 | 141 | }
|
0 commit comments