Skip to content

Commit

Permalink
Use unique moduleName parameters (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
05nelsonm authored Aug 31, 2024
1 parent e565c1a commit d0bfdd6
Show file tree
Hide file tree
Showing 7 changed files with 1,520 additions and 76 deletions.
1,505 changes: 1,480 additions & 25 deletions .kotlin-js-store/yarn.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions build-logic/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ plugins {
}

dependencies {
implementation(libs.gradle.kotlin)
implementation(libs.gradle.maven.publish)
implementation(libs.gradle.kmp.configuration)
implementation(libs.gradle.kotlin)
implementation(libs.gradle.publish.maven)
}
26 changes: 13 additions & 13 deletions build-logic/src/main/kotlin/-KmpConfigurationExtension.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,31 +25,31 @@ fun KmpConfigurationExtension.configureShared(
publish: Boolean = false,
action: Action<KmpConfigurationContainerDsl>
) {
if (publish) {
require(!java9ModuleName.isNullOrBlank()) { "publications must specify a module-info name" }
}

configure {
options {
useUniqueModuleNames = true
}

jvm {
kotlinJvmTarget = JavaVersion.VERSION_1_8
compileSourceCompatibility = JavaVersion.VERSION_1_8
compileTargetCompatibility = JavaVersion.VERSION_1_8

@OptIn(ExperimentalKmpConfigurationApi::class)
java9MultiReleaseModuleInfo(java9ModuleName)
java9ModuleInfoName = java9ModuleName
}

js()

@OptIn(ExperimentalWasmDsl::class)
wasmJs {
target {
browser {
testTask {
useMocha { timeout = "30s" }
}
}
nodejs {
testTask {
useMocha { timeout = "30s" }
}
}
browser()
nodejs()
}
}

Expand All @@ -71,7 +71,7 @@ fun KmpConfigurationExtension.configureShared(
mingwAll()

common {
if (publish) { pluginIds("publication") }
if (publish) pluginIds("publication")

sourceSetTest {
dependencies {
Expand All @@ -80,7 +80,7 @@ fun KmpConfigurationExtension.configureShared(
}
}

kotlin { explicitApi() }
if (publish) kotlin { explicitApi() }

action.execute(this)
}
Expand Down
19 changes: 2 additions & 17 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
**/
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin
import org.jetbrains.kotlin.gradle.targets.js.npm.tasks.KotlinNpmInstallTask
import org.jetbrains.kotlin.gradle.targets.js.yarn.YarnPlugin
import org.jetbrains.kotlin.gradle.targets.js.yarn.YarnRootExtension

plugins {
alias(libs.plugins.multiplatform) apply(false)
alias(libs.plugins.android.library) apply(false)
alias(libs.plugins.binaryCompat)
alias(libs.plugins.binary.compat)
alias(libs.plugins.kotlin.multiplatform) apply(false)
}

allprojects {

findProperty("GROUP")?.let { group = it }
findProperty("VERSION_NAME")?.let { version = it }
findProperty("POM_DESCRIPTION")?.let { description = it.toString() }
Expand All @@ -40,17 +36,6 @@ plugins.withType<YarnPlugin> {
the<YarnRootExtension>().lockFileDirectory = rootDir.resolve(".kotlin-js-store")
}

plugins.withType<NodeJsRootPlugin> {
the<NodeJsRootExtension>().apply {
nodeVersion = "21.0.0-v8-canary202309167e82ab1fa2"
nodeDownloadBaseUrl = "https://nodejs.org/download/v8-canary"
}

tasks.withType<KotlinNpmInstallTask>().configureEach {
args.add("--ignore-engines")
}
}

apiValidation {
if (findProperty("CHECK_PUBLICATION") != null) {
ignoredProjects.add("check-publication")
Expand Down
36 changes: 20 additions & 16 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
[versions]
android = "8.1.4"
androidxTestRunner = "1.5.2"
binaryCompat = "0.14.0"
configuration = "0.2.1"
endians = "0.3.0"
kotlin = "1.9.23"
publish = "0.27.0"
gradle-android = "8.2.2"
gradle-binary-compat = "0.14.0"
gradle-kmp-configuration = "0.3.2"
gradle-kotlin = "1.9.24"
gradle-publish-maven = "0.29.0"

kotlincrypto-endians = "0.3.0"

# tests
androidx-test-runner = "1.5.2"

[libraries]
kotlincrypto-endians-endians = { module = "org.kotlincrypto.endians:endians", version.ref = "endians" }
gradle-kmp-configuration = { module = "io.matthewnelson:gradle-kmp-configuration-plugin", version.ref = "configuration" }
gradle-kotlin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
gradle-maven-publish = { module = "com.vanniktech:gradle-maven-publish-plugin", version.ref = "publish" }
gradle-kmp-configuration = { module = "io.matthewnelson:gradle-kmp-configuration-plugin", version.ref = "gradle-kmp-configuration" }
gradle-kotlin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "gradle-kotlin" }
gradle-publish-maven = { module = "com.vanniktech:gradle-maven-publish-plugin", version.ref = "gradle-publish-maven" }

kotlincrypto-endians-endians = { module = "org.kotlincrypto.endians:endians", version.ref = "kotlincrypto-endians" }

# Tests
androidx-test-runner = { module = "androidx.test:runner", version.ref = "androidxTestRunner" }
# tests
androidx-test-runner = { module = "androidx.test:runner", version.ref = "androidx-test-runner" }

[plugins]
android-library = { id = "com.android.library", version.ref = "android" }
binaryCompat = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "binaryCompat" }
multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
android-library = { id = "com.android.library", version.ref = "gradle-android" }
binary-compat = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "gradle-binary-compat" }
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "gradle-kotlin" }
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME

# https://gradle.org/release-checksums/
distributionSha256Sum=85719317abd2112f021d4f41f09ec370534ba288432065f4b477b6a3b652910d
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip
distributionSha256Sum=f8b4f4772d302c8ff580bc40d0f56e715de69b163546944f787c87abf209c961
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip
2 changes: 1 addition & 1 deletion test-android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ kmpConfiguration {

android {
namespace = "org.kotlincrypto.core"
compileSdk = 33
compileSdk = 34

defaultConfig {
minSdk = 14
Expand Down

0 comments on commit d0bfdd6

Please sign in to comment.