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

ci: Publish RxAndroidBle fork to Artifactory (DROID-1123) #6

Merged
merged 2 commits into from
Jul 30, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 1 addition & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ buildscript {
classpath 'com.github.ben-manes:gradle-versions-plugin:0.21.0'
classpath 'gradle.plugin.org.codehaus.groovy:groovy-android-gradle-plugin:3.0.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:4.17.2'
}
}

Expand All @@ -26,7 +26,6 @@ allprojects {
repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }
}

buildscript {
Expand Down
3 changes: 0 additions & 3 deletions dagger-compiler-shadow/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ buildscript {

apply plugin: 'java'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'com.github.dcendents.android-maven'

group='com.github.proxyco'

def buildSrcDir = '../gradle'
apply from: "${buildSrcDir}/shadow.gradle"
Expand Down
4 changes: 1 addition & 3 deletions dagger-library-shadow/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ apply plugin: 'java'
apply plugin: 'com.github.johnrengelman.shadow'
//apply from: rootProject.file('gradle/gradle-mvn-push.gradle')

apply plugin: 'com.github.dcendents.android-maven'

group='com.github.proxyco'
apply from: rootProject.file('gradle/artifactory-publish.gradle')

def buildSrcDir = '../gradle'
apply from: "${buildSrcDir}/shadow.gradle"
Expand Down
5 changes: 4 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
GROUP=com.polidea.rxandroidble2
GROUP=co.proxy
VERSION_NAME=1.12.2-SNAPSHOT

POM_DESCRIPTION=RxJava backed support for Bluetooth Low Energy in Android
Expand All @@ -19,3 +19,6 @@ POM_DEVELOPER_NAME2=Paweł Urban

android.useAndroidX=true
android.enableJetifier=false

artifactoryUsername=android-gradle
artifactoryPassword=TQy+dwFh6vdHt

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these be env variables from 1Password?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They should be in 1password, aren't they?

Copy link

@sonrohan sonrohan Jul 30, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant should the script itself fetch it from the developers/ci machines env var rather than have it plaintext in the repo

And have the names be like

proxyAndroidArtifcatoryUsername
proxyAndroidArtifcatoryPassword

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not running on any ci, only local machine as it is not updated very often. We should however do that for the android repo, not just for the artifactory credentials but others as well.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, removed from repo and added in 1Password

43 changes: 43 additions & 0 deletions gradle/artifactory-publish.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
apply plugin: 'com.jfrog.artifactory'
apply plugin: 'maven-publish'

def isAndroidProject() {
return project.getPlugins().hasPlugin('com.android.application') || project.getPlugins().hasPlugin('com.android.library')
}

afterEvaluate {
publishing {
publications {
aar(MavenPublication) {
if (isAndroidProject()) {
from components.release
}
else {
from components.java
}

groupId = GROUP
artifactId = POM_ARTIFACT_ID
version = VERSION_NAME
}
}
}

artifactory {
contextUrl = 'https://proxyco.jfrog.io/proxyco'
publish {
repository {
repoKey = 'android-apps'
username = artifactoryUsername
password = artifactoryPassword
maven = true
publishArtifacts = true
publishPom = true
}
}
}

artifactoryPublish {
publications(publishing.publications.aar)
}
}
4 changes: 1 addition & 3 deletions mockrxandroidble/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'groovyx.android'
//apply from: rootProject.file('gradle/gradle-mvn-push.gradle')

apply plugin: 'com.github.dcendents.android-maven'

group='com.github.proxyco'
apply from: rootProject.file('gradle/artifactory-publish.gradle')

android {
compileSdkVersion 29
Expand Down
4 changes: 1 addition & 3 deletions rxandroidble/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'groovyx.android'
//apply from: rootProject.file('gradle/gradle-mvn-push.gradle')

apply plugin: 'com.github.dcendents.android-maven'

group='com.github.proxyco'
apply from: rootProject.file('gradle/artifactory-publish.gradle')

android {
compileSdkVersion 29
Expand Down
3 changes: 0 additions & 3 deletions sample-kotlin/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
apply plugin: 'com.android.application'
apply plugin: 'org.jetbrains.kotlin.android'
apply plugin: 'org.jetbrains.kotlin.android.extensions'
apply plugin: 'com.github.dcendents.android-maven'

group='com.github.proxyco'

android {
compileSdkVersion 29
Expand Down
4 changes: 0 additions & 4 deletions sample/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
apply plugin: 'com.android.application'

apply plugin: 'com.github.dcendents.android-maven'

group='com.github.proxyco'

buildscript {
repositories {
mavenCentral()
Expand Down