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

Bump minor version and tweak deploy script. #137

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
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
9 changes: 3 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -17,14 +17,11 @@ jobs:
- name: Setup Java JDK
uses: actions/[email protected]
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'

13 changes: 5 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -34,5 +32,4 @@ kover {
}
}
}
runAllTestsForProjectTask = true
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
15 changes: 8 additions & 7 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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"
Expand All @@ -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" }
Expand All @@ -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" }
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
11 changes: 7 additions & 4 deletions safeToRun/build.gradle
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -20,6 +17,12 @@ apply from: "${rootProject.projectDir}/scripts/publish-module.gradle"
android {
compileSdkVersion 33

publishing {
singleVariant('release') {
withSourcesJar()
withJavadocJar()
}
}

defaultConfig {
minSdkVersion 24
Expand Down
1 change: 0 additions & 1 deletion safeToRunBuilder/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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`
Expand Down
Binary file removed safeToRunBuilder/build/libs/safeToRunBuilder-all.jar
Binary file not shown.
1 change: 0 additions & 1 deletion safeToRunCore/build.gradle
Original file line number Diff line number Diff line change
@@ -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'
}
Expand Down
7 changes: 6 additions & 1 deletion safeToRunInputValidation/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
plugins {
id("org.jetbrains.dokka")
id "com.diffplug.spotless"
id "io.gitlab.arturbosch.detekt"
id 'org.jetbrains.kotlinx.kover'
}
Expand Down Expand Up @@ -32,6 +31,12 @@ android {
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
}
publishing {
singleVariant('release') {
withSourcesJar()
withJavadocJar()
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_11
Expand Down
4 changes: 1 addition & 3 deletions safeToRunInternal/build.gradle
Original file line number Diff line number Diff line change
@@ -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'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import java.io.File
* @param fileName configuration file url
*/
fun configurationParser(fileName: File) =
Json.decodeFromString(
Json.decodeFromString<SafeToRunConfiguration>(
SafeToRunConfiguration.serializer(),
fileName.readText(),
)
Expand Down
7 changes: 6 additions & 1 deletion safetorunpinscreen/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
plugins {
id("org.jetbrains.dokka")
id "com.diffplug.spotless"
id "io.gitlab.arturbosch.detekt"
id 'org.jetbrains.kotlinx.kover'
}
Expand All @@ -24,6 +23,12 @@ apply from: "${rootProject.projectDir}/scripts/publish-module.gradle"

android {
compileSdkVersion 33
publishing {
singleVariant('release') {
withSourcesJar()
withJavadocJar()
}
}

defaultConfig {
minSdkVersion 23
Expand Down
56 changes: 28 additions & 28 deletions scripts/publish-module.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
Expand Down Expand Up @@ -81,4 +81,4 @@ ext["signing.secretKeyRingFile"] = rootProject.ext["signing.secretKeyRingFile"]

signing {
sign publishing.publications
}
}
Loading