Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modernize build #32

Merged
merged 10 commits into from
Apr 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3f24445329869fd19b9ea3fe72d97aefa768ea0a
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ build/
.idea
local.properties

.DS_Store
23 changes: 23 additions & 0 deletions .run/assemble.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="assemble" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="assemble" />
</list>
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<method v="2" />
</configuration>
</component>
23 changes: 23 additions & 0 deletions .run/check.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="check" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="check" />
</list>
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<method v="2" />
</configuration>
</component>
25 changes: 25 additions & 0 deletions build-conventions/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
plugins {
`kotlin-dsl`
}

buildscript {
dependencyLocking {
lockAllConfigurations()
}
}

dependencyLocking {
lockAllConfigurations()
}

// Per conversation in the KotlinLang Slack, Gradle uses Java 8 compatibility internally
// for all build scripts.
// https://kotlinlang.slack.com/archives/C19FD9681/p1636632870122900?thread_ts=1636572288.117000&cid=C19FD9681
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

dependencies {
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:${libs.versions.kotlin.get()}")
}
45 changes: 45 additions & 0 deletions build-conventions/buildscript-gradle.lockfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# This is a Gradle generated file for dependency locking.
# Manual edits can break the build and are not advised.
# This file is expected to be part of source control.
com.github.gundy:semver4j:0.16.4=classpath
com.google.code.findbugs:jsr305:3.0.2=classpath
com.google.code.gson:gson:2.8.6=classpath
com.google.errorprone:error_prone_annotations:2.3.4=classpath
com.google.guava:failureaccess:1.0.1=classpath
com.google.guava:guava:29.0-jre=classpath
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=classpath
com.google.j2objc:j2objc-annotations:1.3=classpath
de.undercouch:gradle-download-task:4.1.1=classpath
org.checkerframework:checker-qual:2.11.1=classpath
org.gradle.kotlin.kotlin-dsl:org.gradle.kotlin.kotlin-dsl.gradle.plugin:2.1.7=classpath
org.gradle.kotlin:gradle-kotlin-dsl-plugins:2.1.7=classpath
org.jetbrains.intellij.deps:trove4j:1.0.20181211=classpath
org.jetbrains.kotlin:kotlin-android-extensions:1.5.31=classpath
org.jetbrains.kotlin:kotlin-annotation-processing-gradle:1.5.31=classpath
org.jetbrains.kotlin:kotlin-build-common:1.5.31=classpath
org.jetbrains.kotlin:kotlin-compiler-embeddable:1.5.31=classpath
org.jetbrains.kotlin:kotlin-compiler-runner:1.5.31=classpath
org.jetbrains.kotlin:kotlin-daemon-client:1.5.31=classpath
org.jetbrains.kotlin:kotlin-daemon-embeddable:1.5.31=classpath
org.jetbrains.kotlin:kotlin-gradle-plugin-api:1.5.31=classpath
org.jetbrains.kotlin:kotlin-gradle-plugin-model:1.5.31=classpath
org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31=classpath
org.jetbrains.kotlin:kotlin-klib-commonizer-api:1.5.31=classpath
org.jetbrains.kotlin:kotlin-native-utils:1.5.31=classpath
org.jetbrains.kotlin:kotlin-project-model:1.5.31=classpath
org.jetbrains.kotlin:kotlin-sam-with-receiver:1.5.31=classpath
org.jetbrains.kotlin:kotlin-scripting-common:1.5.31=classpath
org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:1.5.31=classpath
org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:1.5.31=classpath
org.jetbrains.kotlin:kotlin-scripting-jvm:1.5.31=classpath
org.jetbrains.kotlin:kotlin-stdlib-common:1.5.31=classpath
org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.5.31=classpath
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.31=classpath
org.jetbrains.kotlin:kotlin-stdlib:1.5.31=classpath
org.jetbrains.kotlin:kotlin-tooling-metadata:1.5.31=classpath
org.jetbrains.kotlin:kotlin-util-io:1.5.31=classpath
org.jetbrains.kotlin:kotlin-util-klib:1.5.31=classpath
org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.5.0=classpath
org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0=classpath
org.jetbrains:annotations:13.0=classpath
empty=
13 changes: 13 additions & 0 deletions build-conventions/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
@Suppress("UnstableApiUsage")
dependencyResolutionManagement {
repositories {
mavenCentral()
}
dependencyResolutionManagement {
versionCatalogs {
create("libs") {
from(files("../gradle/libs.versions.toml"))
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import org.gradle.jvm.toolchain.JavaToolchainSpec

pluginManager.withPlugin("org.jetbrains.kotlin.multiplatform") {
extensions.findByType<org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension>()?.apply {
jvmToolchain {
val javaVersion = JavaVersion.toVersion(project.property("JVM_TOOLCHAIN").toString())
val javaLanguageVersion = JavaLanguageVersion.of(javaVersion.majorVersion)
(this as JavaToolchainSpec).languageVersion.set(javaLanguageVersion)
}

targets.matching { it.platformType.name == "jvm" }.all {
(this as org.jetbrains.kotlin.gradle.targets.jvm.KotlinJvmTarget).apply {
val javaTargetVersion = project.property("JVM_TARGET").toString()

compilations.all {
kotlinOptions {
jvmTarget = javaTargetVersion
}
}
}
}

targets.all {
compilations.all {
kotlinOptions {
allWarningsAsErrors = project.property("BIP39_IS_TREAT_WARNINGS_AS_ERRORS").toString().toBoolean()
freeCompilerArgs = freeCompilerArgs + "-opt-in=kotlin.RequiresOptIn"
}
}
}
}
}
23 changes: 0 additions & 23 deletions build.gradle

This file was deleted.

7 changes: 0 additions & 7 deletions buildSrc/build.gradle.kts

This file was deleted.

24 changes: 0 additions & 24 deletions buildSrc/src/main/java/cash/z/ecc/android/Dependencies.kt

This file was deleted.

15 changes: 15 additions & 0 deletions lib/gradle.properties → gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# Speed up builds. Keep these flags here for quick debugging of issues.
# https://github.com/gradle/gradle/issues/13382
org.gradle.vfs.watch=false
org.gradle.configureondemand=false
org.gradle.caching=true
org.gradle.parallel=true
org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m

kotlin.mpp.stability.nowarn=true

BIP39_IS_TREAT_WARNINGS_AS_ERRORS=false

JVM_TOOLCHAIN=17
JVM_TARGET=1.8

# Publishing : Required
GROUP=cash.z.ecc.android
POM_ARTIFACT_ID=kotlin-bip39
Expand Down
17 changes: 17 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[versions]
kotlin = "1.6.21"
kotest = "4.6.1"
moshi = "1.9.2"

[libraries]
kotest-runner = { module = "io.kotest:kotest-runner-junit5-jvm", version.ref = "kotest" }
kotest-assertion = { module = "io.kotest:kotest-assertions-core-jvm", version.ref = "kotest" }
kotest-property = { module = "io.kotest:kotest-property-jvm", version.ref = "kotest" }
moshi-core = { module = "com.squareup.moshi:moshi", version.ref = "moshi" }
moshi-kotlin = { module = "com.squareup.moshi:moshi-kotlin", version.ref = "moshi" }

[plugins]
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
dokka = "org.jetbrains.dokka:1.6.20"
versions = "com.github.ben-manes.versions:0.42.0"
publish = "com.vanniktech.maven.publish:0.18.0"
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Fri May 29 16:32:57 EDT 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
distributionSha256Sum=29e49b10984e585d8118b7d0bc452f944e386458df27371b49b4ac1dec4b7fda
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-all.zip
Loading