Issue#67 Define deployment of libraries to GitHub

This commit is contained in:
Gergely Hegedus 2022-07-12 12:58:01 +03:00
parent b8b2e0e29e
commit 6156e9457f
7 changed files with 61 additions and 6 deletions

View file

@ -18,4 +18,5 @@ android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=false
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
kotlin.code.style=official
android.disableAutomaticComponentCreation=true

View file

@ -0,0 +1,44 @@
apply plugin: "maven-publish"
def testUtilVersion = "1.0.0"
if (!extensions.extraProperties.has("artifactId")) {
throw IllegalStateException("ext.artifactId is not set while applying deploy script")
}
def testUtilGroupId = "org.fnives.android.testutil"
def testUtilArtifactId = extensions.extraProperties.get("artifactId")
task publishToGitHub(dependsOn: "publishMavenAarPublicationToGitHubPackagesRepository") {
group = "Publishing"
}
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier "sources"
}
afterEvaluate {
publishing {
publications {
mavenAar(MavenPublication) {
from components.release
groupId "$testUtilGroupId"
println("$testUtilArtifactId")
version "$testUtilVersion"
artifactId "$testUtilArtifactId"
artifact sourcesJar
}
}
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/fknives/AndroidTest-ShowCase")
credentials {
username = System.getenv("GITHUB_USERNAME")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}
}

View file

@ -27,7 +27,6 @@ project.ext {
arch_core_version = "2.1.0"
testing_livedata_version = "1.2.0"
mockito_version = "4.0.0"
println("MYLOG versions set")
junit5_version = "5.7.0"
json_assert_version = "1.5.0"
junit4_version = "4.13.2"

View file

@ -44,4 +44,7 @@ dependencies {
implementation "com.google.android.material:material:$androidx_material_version"
implementation "androidx.swiperefreshlayout:swiperefreshlayout:$androidx_swiperefreshlayout_version"
implementation "androidx.core:core-ktx:$androidx_core_version"
}
}
ext.artifactId = "android"
apply from: "../gradlescripts/deploy.aar.gradle"

View file

@ -37,4 +37,7 @@ dependencies {
implementation "androidx.arch.core:core-runtime:$arch_core_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutines_version"
}
}
ext.artifactId = "android-unit-junit5"
apply from: "../gradlescripts/deploy.aar.gradle"

View file

@ -35,5 +35,7 @@ android {
dependencies {
implementation "androidx.room:room-testing:$room_version"
api project(':test-util-shared-robolectric')
}
}
ext.artifactId = "shared-android"
apply from: "../gradlescripts/deploy.aar.gradle"

View file

@ -35,4 +35,7 @@ android {
dependencies {
implementation "androidx.room:room-testing:$room_version"
implementation "androidx.arch.core:core-testing:$arch_core_version"
}
}
ext.artifactId = "shared-robolectric"
apply from: "../gradlescripts/deploy.aar.gradle"