Skip to content

Commit fff249f

Browse files
authored
Use unique moduleName parameters (#50)
1 parent 303d323 commit fff249f

File tree

12 files changed

+67
-75
lines changed

12 files changed

+67
-75
lines changed

.kotlin-js-store/yarn.lock

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ brace-expansion@^2.0.1:
5858
balanced-match "^1.0.0"
5959

6060
braces@~3.0.2:
61-
version "3.0.2"
62-
resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107"
63-
integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==
61+
version "3.0.3"
62+
resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789"
63+
integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==
6464
dependencies:
65-
fill-range "^7.0.1"
65+
fill-range "^7.1.1"
6666

6767
browser-stdout@1.3.1:
6868
version "1.3.1"
@@ -151,19 +151,19 @@ emoji-regex@^8.0.0:
151151
integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==
152152

153153
escalade@^3.1.1:
154-
version "3.1.2"
155-
resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.2.tgz#54076e9ab29ea5bf3d8f1ed62acffbb88272df27"
156-
integrity sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==
154+
version "3.2.0"
155+
resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.2.0.tgz#011a3f69856ba189dffa7dc8fcce99d2a87903e5"
156+
integrity sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==
157157

158158
escape-string-regexp@4.0.0:
159159
version "4.0.0"
160160
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34"
161161
integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==
162162

163-
fill-range@^7.0.1:
164-
version "7.0.1"
165-
resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40"
166-
integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==
163+
fill-range@^7.1.1:
164+
version "7.1.1"
165+
resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292"
166+
integrity sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==
167167
dependencies:
168168
to-regex-range "^5.0.1"
169169

build-logic/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ plugins {
1818
}
1919

2020
dependencies {
21-
implementation(libs.gradle.kotlin)
22-
implementation(libs.gradle.maven.publish)
2321
implementation(libs.gradle.kmp.configuration)
22+
implementation(libs.gradle.kotlin)
23+
implementation(libs.gradle.publish.maven)
2424
}

build-logic/src/main/kotlin/-KmpConfigurationExtension.kt

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,25 @@ import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
2323
fun KmpConfigurationExtension.configureShared(
2424
java9ModuleName: String? = null,
2525
publish: Boolean = false,
26-
explicitApi: Boolean = true,
2726
action: Action<KmpConfigurationContainerDsl>
2827
) {
28+
// TODO: Enable once module :library:hmac:hmac-md5 is removed
29+
// if (publish) {
30+
// require(!java9ModuleName.isNullOrBlank()) { "publications must specify a module-info name" }
31+
// }
32+
2933
configure {
34+
options {
35+
useUniqueModuleNames = true
36+
}
37+
3038
jvm {
3139
kotlinJvmTarget = JavaVersion.VERSION_1_8
3240
compileSourceCompatibility = JavaVersion.VERSION_1_8
3341
compileTargetCompatibility = JavaVersion.VERSION_1_8
3442

3543
@OptIn(ExperimentalKmpConfigurationApi::class)
36-
java9MultiReleaseModuleInfo(java9ModuleName)
44+
java9ModuleInfoName = java9ModuleName
3745
}
3846

3947
js()
@@ -46,11 +54,7 @@ fun KmpConfigurationExtension.configureShared(
4654
useMocha { timeout = "30s" }
4755
}
4856
}
49-
nodejs {
50-
testTask {
51-
useMocha { timeout = "30s" }
52-
}
53-
}
57+
nodejs()
5458
}
5559
}
5660

@@ -72,7 +76,7 @@ fun KmpConfigurationExtension.configureShared(
7276
mingwAll()
7377

7478
common {
75-
if (publish) { pluginIds("publication") }
79+
if (publish) pluginIds("publication")
7680

7781
sourceSetTest {
7882
dependencies {
@@ -81,7 +85,7 @@ fun KmpConfigurationExtension.configureShared(
8185
}
8286
}
8387

84-
if (explicitApi) { kotlin { explicitApi() } }
88+
if (publish) kotlin { explicitApi() }
8589

8690
action.execute(this)
8791
}

build.gradle.kts

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,16 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
**/
16-
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension
17-
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin
18-
import org.jetbrains.kotlin.gradle.targets.js.npm.tasks.KotlinNpmInstallTask
1916
import org.jetbrains.kotlin.gradle.targets.js.yarn.YarnPlugin
2017
import org.jetbrains.kotlin.gradle.targets.js.yarn.YarnRootExtension
2118

2219
plugins {
23-
alias(libs.plugins.multiplatform) apply(false)
2420
alias(libs.plugins.android.library) apply(false)
25-
alias(libs.plugins.binaryCompat)
21+
alias(libs.plugins.binary.compat)
22+
alias(libs.plugins.kotlin.multiplatform) apply(false)
2623
}
2724

2825
allprojects {
29-
3026
findProperty("GROUP")?.let { group = it }
3127
findProperty("VERSION_NAME")?.let { version = it }
3228
findProperty("POM_DESCRIPTION")?.let { description = it.toString() }
@@ -41,24 +37,12 @@ allprojects {
4137
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/")
4238
}
4339
}
44-
4540
}
4641

4742
plugins.withType<YarnPlugin> {
4843
the<YarnRootExtension>().lockFileDirectory = rootDir.resolve(".kotlin-js-store")
4944
}
5045

51-
plugins.withType<NodeJsRootPlugin> {
52-
the<NodeJsRootExtension>().apply {
53-
nodeVersion = "21.0.0-v8-canary202309167e82ab1fa2"
54-
nodeDownloadBaseUrl = "https://nodejs.org/download/v8-canary"
55-
}
56-
57-
tasks.withType<KotlinNpmInstallTask>().configureEach {
58-
args.add("--ignore-engines")
59-
}
60-
}
61-
6246
apiValidation {
6347
if (findProperty("CHECK_PUBLICATION") != null) {
6448
ignoredProjects.add("check-publication")

gradle/libs.versions.toml

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,38 @@
11
[versions]
2-
android = "8.1.4"
3-
androidxTestRunner = "1.5.2"
4-
binaryCompat = "0.14.0"
5-
bouncyCastle = "1.73"
6-
configuration = "0.2.1"
7-
cryptoCore = "0.5.1"
8-
cryptoHash = "0.5.1"
9-
encoding = "2.2.1"
10-
kotlin = "1.9.23"
11-
publish = "0.27.0"
2+
gradle-android = "8.2.2"
3+
gradle-binary-compat = "0.14.0"
4+
gradle-kmp-configuration = "0.3.2"
5+
gradle-kotlin = "1.9.24"
6+
gradle-publish-maven = "0.29.0"
7+
8+
kotlincrypto-core = "0.5.1"
9+
kotlincrypto-hash = "0.5.1"
10+
11+
# tests
12+
androidx-test-runner = "1.5.2"
13+
bouncy-castle = "1.73"
14+
encoding = "2.2.2"
1215

1316
[libraries]
14-
kotlincrypto-core-digest = { module = "org.kotlincrypto.core:digest", version.ref = "cryptoCore" }
15-
kotlincrypto-core-mac = { module = "org.kotlincrypto.core:mac", version.ref = "cryptoCore" }
16-
kotlincrypto-core-xof = { module = "org.kotlincrypto.core:xof", version.ref = "cryptoCore" }
17-
kotlincrypto-hash-md = { module = "org.kotlincrypto.hash:md", version.ref = "cryptoHash" }
18-
kotlincrypto-hash-sha1 = { module = "org.kotlincrypto.hash:sha1", version.ref = "cryptoHash" }
19-
kotlincrypto-hash-sha2 = { module = "org.kotlincrypto.hash:sha2", version.ref = "cryptoHash" }
20-
kotlincrypto-hash-sha3 = { module = "org.kotlincrypto.hash:sha3", version.ref = "cryptoHash" }
21-
gradle-kmp-configuration = { module = "io.matthewnelson:gradle-kmp-configuration-plugin", version.ref = "configuration" }
22-
gradle-kotlin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
23-
gradle-maven-publish = { module = "com.vanniktech:gradle-maven-publish-plugin", version.ref = "publish" }
17+
gradle-kmp-configuration = { module = "io.matthewnelson:gradle-kmp-configuration-plugin", version.ref = "gradle-kmp-configuration" }
18+
gradle-kotlin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "gradle-kotlin" }
19+
gradle-publish-maven = { module = "com.vanniktech:gradle-maven-publish-plugin", version.ref = "gradle-publish-maven" }
20+
21+
kotlincrypto-core-digest = { module = "org.kotlincrypto.core:digest", version.ref = "kotlincrypto-core" }
22+
kotlincrypto-core-mac = { module = "org.kotlincrypto.core:mac", version.ref = "kotlincrypto-core" }
23+
kotlincrypto-core-xof = { module = "org.kotlincrypto.core:xof", version.ref = "kotlincrypto-core" }
24+
kotlincrypto-hash-md = { module = "org.kotlincrypto.hash:md", version.ref = "kotlincrypto-hash" }
25+
kotlincrypto-hash-sha1 = { module = "org.kotlincrypto.hash:sha1", version.ref = "kotlincrypto-hash" }
26+
kotlincrypto-hash-sha2 = { module = "org.kotlincrypto.hash:sha2", version.ref = "kotlincrypto-hash" }
27+
kotlincrypto-hash-sha3 = { module = "org.kotlincrypto.hash:sha3", version.ref = "kotlincrypto-hash" }
2428

25-
# Tests
26-
androidx-test-runner = { module = "androidx.test:runner", version.ref = "androidxTestRunner" }
27-
bouncyCastle = { module = "org.bouncycastle:bcprov-ext-jdk15to18", version.ref = "bouncyCastle" }
29+
# tests
30+
androidx-test-runner = { module = "androidx.test:runner", version.ref = "androidx-test-runner" }
31+
bouncy-castle = { module = "org.bouncycastle:bcprov-ext-jdk15to18", version.ref = "bouncy-castle" }
2832
encoding-base16 = { module = "io.matthewnelson.encoding:base16", version.ref = "encoding" }
2933
encoding-base64 = { module = "io.matthewnelson.encoding:base64", version.ref = "encoding" }
3034

3135
[plugins]
32-
android-library = { id = "com.android.library", version.ref = "android" }
33-
binaryCompat = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "binaryCompat" }
34-
multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
36+
android-library = { id = "com.android.library", version.ref = "gradle-android" }
37+
binary-compat = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "gradle-binary-compat" }
38+
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "gradle-kotlin" }

gradle/wrapper/gradle-wrapper.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ zipStorePath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55

66
# https://gradle.org/release-checksums/
7-
distributionSha256Sum=85719317abd2112f021d4f41f09ec370534ba288432065f4b477b6a3b652910d
8-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip
7+
distributionSha256Sum=f8b4f4772d302c8ff580bc40d0f56e715de69b163546944f787c87abf209c961
8+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip

library/hmac/hmac-sha1/src/jvmMain/java9/module-info.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@SuppressWarnings("JavaModuleNaming")
1+
@SuppressWarnings("module")
22
module org.kotlincrypto.macs.hmac.sha1 {
33
requires kotlin.stdlib;
44
requires org.kotlincrypto.hash.sha1;

library/hmac/hmac-sha2/src/jvmMain/java9/module-info.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@SuppressWarnings("JavaModuleNaming")
1+
@SuppressWarnings("module")
22
module org.kotlincrypto.macs.hmac.sha2 {
33
requires kotlin.stdlib;
44
requires org.kotlincrypto.hash.sha2;

library/hmac/hmac-sha3/src/jvmMain/java9/module-info.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@SuppressWarnings("JavaModuleNaming")
1+
@SuppressWarnings("module")
22
module org.kotlincrypto.macs.hmac.sha3 {
33
requires kotlin.stdlib;
44
requires org.kotlincrypto.hash.sha3;

test-android/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ kmpConfiguration {
3030

3131
android {
3232
namespace = "org.kotlincrypto.macs"
33-
compileSdk = 33
33+
compileSdk = 34
3434

3535
defaultConfig {
3636
minSdk = 14

tools/check-publication/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ repositories {
3535
}
3636

3737
kmpConfiguration {
38-
configureShared(explicitApi = false) {
38+
configureShared {
3939
common {
4040
sourceSetMain {
4141
dependencies {

tools/testing/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ plugins {
1818
}
1919

2020
kmpConfiguration {
21-
configureShared(explicitApi = false) {
21+
configureShared {
2222
jvm {
2323
sourceSetMain {
2424
dependencies {
25-
api(libs.bouncyCastle)
25+
api(libs.bouncy.castle)
2626
}
2727
}
2828
}

0 commit comments

Comments
 (0)