diff --git a/Jenkinsfile b/Jenkinsfile index 3718118..a1436bd 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -10,7 +10,7 @@ openiumDroidJob modules: [ "app": [ unitTestTasks: ["testDevDebugUnitTest"], testTasks: ["pixel5DevDebugAndroidTest"], - publishApkVariants : ["devRelease", "demoRelease", "prodRelease"], + publishApkVariants : ["devDebug", "devRelease", "demoRelease", "prodRelease"], ], ] publishChannel: '#int-consentium' \ No newline at end of file diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 3585a7c..a6caba8 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -1,7 +1,7 @@ +import com.android.build.api.dsl.ManagedVirtualDevice import org.gradle.language.nativeplatform.internal.BuildType import java.io.FileInputStream import java.util.Properties -import com.android.build.api.dsl.ManagedVirtualDevice plugins { alias(libs.plugins.ksp) @@ -10,7 +10,9 @@ plugins { alias(libs.plugins.hilt) alias(libs.plugins.serialization) alias(libs.plugins.kotlin.compose) + id("fr.openium.publish") } +apply(from = "publish.build.gradle") // Keystore val keystorePropertiesFile = rootProject.file("keys/keystore.properties") @@ -25,8 +27,6 @@ android { applicationId = "fr.openium.consentium" minSdk = libs.versions.minSdk.get().toInt() targetSdk = libs.versions.targetSdk.get().toInt() - versionCode = 1 - versionName = "1.0" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" vectorDrawables { @@ -148,5 +148,4 @@ dependencies { // Kotlin serialization implementation(libs.kotlin.serialization) - } \ No newline at end of file diff --git a/app/publish.build.gradle b/app/publish.build.gradle new file mode 100644 index 0000000..ef93776 --- /dev/null +++ b/app/publish.build.gradle @@ -0,0 +1,6 @@ +android { + defaultConfig { + versionName publish.versionName + versionCode publish.versionCode + } +} \ No newline at end of file diff --git a/app/src/androidTest/java/fr/openium/consentium/ExampleInstrumentedTest.kt b/app/src/androidTest/java/fr/openium/consentium/ExampleInstrumentedTest.kt index 1caa96c..66b8df7 100644 --- a/app/src/androidTest/java/fr/openium/consentium/ExampleInstrumentedTest.kt +++ b/app/src/androidTest/java/fr/openium/consentium/ExampleInstrumentedTest.kt @@ -17,8 +17,6 @@ import org.junit.Assert.* class ExampleInstrumentedTest { @Test fun useAppContext() { - // Context of the app under test. - val appContext = InstrumentationRegistry.getInstrumentation().targetContext - assertEquals("fr.openium.consentium", appContext.packageName) + assertTrue(true) } } \ No newline at end of file diff --git a/app/version.properties b/app/version.properties new file mode 100644 index 0000000..02ed9cf --- /dev/null +++ b/app/version.properties @@ -0,0 +1,3 @@ +#Wed Sep 27 10:07:57 CEST 2023 +VERSION_NAME=1.0.0 +VERSION_CODE=1 diff --git a/build.gradle.kts b/build.gradle.kts index 54ed6ac..0c67eba 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -20,4 +20,13 @@ plugins { // Kotlin serialization alias(libs.plugins.serialization) apply false +} + +buildscript { + repositories { + maven { url = uri("https://maven.openium.fr/") } + } + dependencies { + classpath(libs.openium.publish) + } } \ No newline at end of file diff --git a/consentium-ui/src/androidTest/java/fr/openium/consentium_ui/ExampleInstrumentedTest.kt b/consentium-ui/src/androidTest/java/fr/openium/consentium_ui/ExampleInstrumentedTest.kt index 8fbc1c6..b5e8f85 100644 --- a/consentium-ui/src/androidTest/java/fr/openium/consentium_ui/ExampleInstrumentedTest.kt +++ b/consentium-ui/src/androidTest/java/fr/openium/consentium_ui/ExampleInstrumentedTest.kt @@ -1,13 +1,10 @@ package fr.openium.consentium_ui -import androidx.test.platform.app.InstrumentationRegistry import androidx.test.ext.junit.runners.AndroidJUnit4 - +import org.junit.Assert.assertTrue import org.junit.Test import org.junit.runner.RunWith -import org.junit.Assert.* - /** * Instrumented test, which will execute on an Android device. * @@ -17,8 +14,6 @@ import org.junit.Assert.* class ExampleInstrumentedTest { @Test fun useAppContext() { - // Context of the app under test. - val appContext = InstrumentationRegistry.getInstrumentation().targetContext - assertEquals("fr.openium.consentium_ui.test", appContext.packageName) + assertTrue(true) } } \ No newline at end of file diff --git a/consentium/src/androidTest/java/fr/openium/consentium/ExampleInstrumentedTest.kt b/consentium/src/androidTest/java/fr/openium/consentium/ExampleInstrumentedTest.kt index c2f1b40..74ffd17 100644 --- a/consentium/src/androidTest/java/fr/openium/consentium/ExampleInstrumentedTest.kt +++ b/consentium/src/androidTest/java/fr/openium/consentium/ExampleInstrumentedTest.kt @@ -1,13 +1,10 @@ package fr.openium.consentium -import androidx.test.platform.app.InstrumentationRegistry import androidx.test.ext.junit.runners.AndroidJUnit4 - +import org.junit.Assert.assertTrue import org.junit.Test import org.junit.runner.RunWith -import org.junit.Assert.* - /** * Instrumented test, which will execute on an Android device. * @@ -17,8 +14,6 @@ import org.junit.Assert.* class ExampleInstrumentedTest { @Test fun useAppContext() { - // Context of the app under test. - val appContext = InstrumentationRegistry.getInstrumentation().targetContext - assertEquals("fr.openium.consentium.test", appContext.packageName) + assertTrue(true) } } \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 8cb8b2f..7376798 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -73,6 +73,9 @@ foundationLayoutAndroid = "1.7.5" uiAndroid = "1.7.5" material3Android = "1.3.1" +# Publish +publish = "1.2" + [libraries] # AndroidX @@ -146,6 +149,9 @@ coil-network = { module = "io.coil-kt.coil3:coil-network-okhttp", version.ref = # Rich text formating rich-text = { module = "com.mohamedrejeb.richeditor:richeditor-compose", version = "1.0.0-rc05-k2" } +# Publish +openium-publish = { group = "fr.openium", name = "publish-plugin", version.ref = "publish" } + [plugins] android-application = { id = "com.android.application", version.ref = "agp" } kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }