diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b34c042e..50522515 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -# This is a basic workflow to help you get started with Actions +R# This is a basic workflow to help you get started with Actions name: CI @@ -17,14 +17,11 @@ jobs: - name: Setup Java JDK uses: actions/setup-java@v3.9.0 with: - java-version: 11 - distribution: corretto + java-version: 17 + distribution: 'corretto' - uses: actions/checkout@v2 - - name: Build plugin - run: ./gradlew :safeToRunBuilder:shadowJar --no-daemon - name: Run build run: ./gradlew build assembleDebug assembleDebugAndroidTest --no-daemon env: SERVER_URL: 'http://example.com' API_KEY: 'apikey' - \ No newline at end of file diff --git a/build.gradle b/build.gradle index f894687b..bb94bb6c 100644 --- a/build.gradle +++ b/build.gradle @@ -1,21 +1,19 @@ buildscript { dependencies { - classpath files('safeToRunBuilder/build/libs/safeToRunBuilder-all.jar') classpath 'org.owasp:dependency-check-gradle:6.4.1.1' classpath "firebase.test.lab:plugin:2.6.2" } } plugins { - id "com.diffplug.spotless" version "5.7.0" id("io.github.gradle-nexus.publish-plugin") version "1.1.0" id("org.jetbrains.dokka") version "1.7.0" id 'io.codearte.nexus-staging' version '0.11.0' - id "io.gitlab.arturbosch.detekt" version "1.22.0" - id "org.jetbrains.kotlinx.kover" version "0.6.0" - id 'com.android.application' version '7.4.0' apply false - id 'com.android.library' version '7.4.0' apply false - id 'org.jetbrains.kotlin.android' version '1.8.10' apply false + alias(libs.plugins.detekt) + alias(libs.plugins.kotlinx.kover) + alias(libs.plugins.android.application) apply false + alias(libs.plugins.android.library) apply false + alias(libs.plugins.kotlin.android) apply false } apply from: "${rootDir}/scripts/publish-root.gradle" @@ -34,5 +32,4 @@ kover { } } } - runAllTestsForProjectTask = true } diff --git a/gradle.properties b/gradle.properties index 4e2c6284..650f4bf2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -11,4 +11,4 @@ expressoCore=3.4.0 androidXJunit=1.1.3 coroutinesVersion=1.6.4 # Safe to run -safeToRunVersion=3.0.1 +safeToRunVersion=3.0.2 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index f970db3d..1461344b 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,5 +1,5 @@ [versions] -kotlin = "1.8.10" +kotlin = "1.9.0" mockk = "1.13.5" rootbeer = "0.1.0" googleTruth = "1.1.3" @@ -9,7 +9,7 @@ epoxy = "4.6.4" recyclerView = "1.3.0" jodaTime = "2.10.10" jwt = "3.15.0" -serialization = "1.5.0" +serialization = "1.6.0" mockHttp = "5.11.2" coreKtx = "1.6.0" robolectric = "4.10.3" @@ -19,13 +19,14 @@ androidXTest = "1.4.0" expressoCore = "3.4.0" androidXJunit = "1.1.3" coroutines = "1.6.4" -androidGradlePlugin = "7.4.0" -kover = "0.6.0" +androidGradlePlugin = "8.1.0" +kover = "0.7.3" kotlinPoet = "1.11.0" -safeToRun = "3.0.1" +safeToRun = "3.0.2" work_version = "2.8.1" mockHttpVersion = "5.11.2" jupiterVersion = "5.8.1" +detekt = "1.23.1" [libraries] androidx-security-crypto = { module = "androidx.security:security-crypto", version.ref = "securityCrypto" } @@ -46,13 +47,13 @@ junit = { module = "junit:junit", version.ref = "junit" } mockk-server = { module = "org.mock-server:mockserver-netty", version.ref = "mockHttpVersion" } jupiter = { module = "org.junit.jupiter:junit-jupiter", version.ref = "jupiterVersion" } -#kotlin-std = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" } kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlin" } [plugins] kotlinx-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "serialization" } -kotlinx-kover = { id = "org.jetbrains.kotlin.kover", version.ref = "kover" } +kotlinx-kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" } android-application = { id = "com.android.application", version.ref = "androidGradlePlugin" } android-library = { id = "com.android.library", version.ref = "androidGradlePlugin" } kapt = { id = "org.jetbrains.kotlin.kapt", version.ref = "kotlin" } kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } +detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 89d82d01..469ec007 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Mon Apr 12 09:51:02 BST 2021 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME diff --git a/safeToRun/build.gradle b/safeToRun/build.gradle index ed4053a7..af44e912 100644 --- a/safeToRun/build.gradle +++ b/safeToRun/build.gradle @@ -1,13 +1,10 @@ plugins { + id("com.android.library") id("org.jetbrains.dokka") - id "com.diffplug.spotless" id "io.gitlab.arturbosch.detekt" id 'org.jetbrains.kotlinx.kover' - } -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' ext { PUBLISH_GROUP_ID = 'com.safetorun' @@ -20,6 +17,12 @@ apply from: "${rootProject.projectDir}/scripts/publish-module.gradle" android { compileSdkVersion 33 + publishing { + singleVariant('release') { + withSourcesJar() + withJavadocJar() + } + } defaultConfig { minSdkVersion 24 diff --git a/safeToRunBuilder/build.gradle.kts b/safeToRunBuilder/build.gradle.kts index 3eeabc22..fae66ac4 100644 --- a/safeToRunBuilder/build.gradle.kts +++ b/safeToRunBuilder/build.gradle.kts @@ -1,7 +1,6 @@ plugins { id("org.jetbrains.kotlin.jvm") id("io.gitlab.arturbosch.detekt") - id("com.diffplug.spotless") id("org.jetbrains.dokka") id("com.github.johnrengelman.shadow") version "5.0.0" `java-gradle-plugin` diff --git a/safeToRunBuilder/build/libs/safeToRunBuilder-all.jar b/safeToRunBuilder/build/libs/safeToRunBuilder-all.jar deleted file mode 100644 index 973e83eb..00000000 Binary files a/safeToRunBuilder/build/libs/safeToRunBuilder-all.jar and /dev/null differ diff --git a/safeToRunCore/build.gradle b/safeToRunCore/build.gradle index 6f30d37e..baddcd69 100644 --- a/safeToRunCore/build.gradle +++ b/safeToRunCore/build.gradle @@ -1,7 +1,6 @@ plugins { id 'org.jetbrains.kotlin.jvm' id("org.jetbrains.dokka") - id "com.diffplug.spotless" id "io.gitlab.arturbosch.detekt" id 'org.jetbrains.kotlinx.kover' } diff --git a/safeToRunInputValidation/build.gradle b/safeToRunInputValidation/build.gradle index 8f4d8deb..6c2b360b 100644 --- a/safeToRunInputValidation/build.gradle +++ b/safeToRunInputValidation/build.gradle @@ -1,6 +1,5 @@ plugins { id("org.jetbrains.dokka") - id "com.diffplug.spotless" id "io.gitlab.arturbosch.detekt" id 'org.jetbrains.kotlinx.kover' } @@ -32,6 +31,12 @@ android { testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles "consumer-rules.pro" } + publishing { + singleVariant('release') { + withSourcesJar() + withJavadocJar() + } + } compileOptions { sourceCompatibility JavaVersion.VERSION_11 diff --git a/safeToRunInternal/build.gradle b/safeToRunInternal/build.gradle index 2a607267..2277f500 100644 --- a/safeToRunInternal/build.gradle +++ b/safeToRunInternal/build.gradle @@ -1,10 +1,8 @@ plugins { id 'org.jetbrains.kotlin.jvm' id("org.jetbrains.dokka") - id "com.diffplug.spotless" id "io.gitlab.arturbosch.detekt" - id 'org.jetbrains.kotlin.plugin.serialization' version '1.5.0' - id("com.github.johnrengelman.shadow") version "5.0.0" + id "org.jetbrains.kotlin.plugin.serialization" id 'org.jetbrains.kotlinx.kover' } diff --git a/safeToRunInternal/src/main/kotlin/com/safetorun/inputverification/configurationParser.kt b/safeToRunInternal/src/main/kotlin/com/safetorun/inputverification/configurationParser.kt index 9148eeb6..1c2a7b51 100644 --- a/safeToRunInternal/src/main/kotlin/com/safetorun/inputverification/configurationParser.kt +++ b/safeToRunInternal/src/main/kotlin/com/safetorun/inputverification/configurationParser.kt @@ -15,7 +15,7 @@ import java.io.File * @param fileName configuration file url */ fun configurationParser(fileName: File) = - Json.decodeFromString( + Json.decodeFromString( SafeToRunConfiguration.serializer(), fileName.readText(), ) diff --git a/safetorunpinscreen/build.gradle b/safetorunpinscreen/build.gradle index 79942381..685c4af0 100644 --- a/safetorunpinscreen/build.gradle +++ b/safetorunpinscreen/build.gradle @@ -1,6 +1,5 @@ plugins { id("org.jetbrains.dokka") - id "com.diffplug.spotless" id "io.gitlab.arturbosch.detekt" id 'org.jetbrains.kotlinx.kover' } @@ -24,6 +23,12 @@ apply from: "${rootProject.projectDir}/scripts/publish-module.gradle" android { compileSdkVersion 33 + publishing { + singleVariant('release') { + withSourcesJar() + withJavadocJar() + } + } defaultConfig { minSdkVersion 23 diff --git a/scripts/publish-module.gradle b/scripts/publish-module.gradle index de079e62..e79dbe20 100644 --- a/scripts/publish-module.gradle +++ b/scripts/publish-module.gradle @@ -3,29 +3,29 @@ apply plugin: 'signing' group = PUBLISH_GROUP_ID version = PUBLISH_VERSION +// +//task androidSourcesJar(type: Jar) { +// archiveClassifier.set('sources') +// if (project.plugins.findPlugin("com.android.library")) { +// // For Android libraries +// from android.sourceSets.main.java.srcDirs +// from android.sourceSets.main.kotlin.srcDirs +// } else { +// // For pure Kotlin libraries, in case you have them +// from sourceSets.main.java.srcDirs +// from sourceSets.main.kotlin.srcDirs +// } +//} +// +//task javadocJar(type: Jar, dependsOn: dokkaJavadoc) { +// archiveClassifier.set('javadoc') +// from dokkaJavadoc.outputDirectory +//} -task androidSourcesJar(type: Jar) { - archiveClassifier.set('sources') - if (project.plugins.findPlugin("com.android.library")) { - // For Android libraries - from android.sourceSets.main.java.srcDirs - from android.sourceSets.main.kotlin.srcDirs - } else { - // For pure Kotlin libraries, in case you have them - from sourceSets.main.java.srcDirs - from sourceSets.main.kotlin.srcDirs - } -} - -task javadocJar(type: Jar, dependsOn: dokkaJavadoc) { - archiveClassifier.set('javadoc') - from dokkaJavadoc.outputDirectory -} - -artifacts { - archives androidSourcesJar - archives javadocJar -} +//artifacts { +// archives androidSourcesJar +// archives javadocJar +//} afterEvaluate { publishing { @@ -35,11 +35,11 @@ afterEvaluate { artifactId PUBLISH_ARTIFACT_ID version PUBLISH_VERSION - if (project.plugins.findPlugin("com.android.library")) { - from components.release - } else { - artifact("$buildDir/libs/${project.getName()}-${version}.jar") - } +// if (project.plugins.findPlugin("com.android.library")) { +// from components.release +// } else { +// artifact("$buildDir/libs/${project.getName()}-${version}.jar") +// } artifact androidSourcesJar artifact javadocJar @@ -81,4 +81,4 @@ ext["signing.secretKeyRingFile"] = rootProject.ext["signing.secretKeyRingFile"] signing { sign publishing.publications -} \ No newline at end of file +}