From 3624e1f580f6c363e8592d769b47c365cd0b9791 Mon Sep 17 00:00:00 2001 From: JongChern Date: Mon, 24 Jul 2023 12:37:13 +0800 Subject: [PATCH 1/3] moving to using github packages --- .../ShimmerAndroidInstrumentDriver/build.gradle | 8 ++++++-- ShimmerAndroidInstrumentDriver/build.gradle | 8 ++++++-- .../shimmerServiceExample/build.gradle | 4 ++-- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/ShimmerAndroidInstrumentDriver/ShimmerAndroidInstrumentDriver/build.gradle b/ShimmerAndroidInstrumentDriver/ShimmerAndroidInstrumentDriver/build.gradle index 7f035ecd..cf19123d 100644 --- a/ShimmerAndroidInstrumentDriver/ShimmerAndroidInstrumentDriver/build.gradle +++ b/ShimmerAndroidInstrumentDriver/ShimmerAndroidInstrumentDriver/build.gradle @@ -56,6 +56,9 @@ android { } } + + +/* publishing { artifactoryPublish.dependsOn('build') publications { @@ -67,6 +70,7 @@ publishing { } } } +*/ dependencies { compile 'com.google.guava:guava:20.0' @@ -74,13 +78,13 @@ dependencies { compile files('libs/ShimmerBiophysicalProcessingLibrary_Rev_0_11.jar') compile files('libs/AndroidBluetoothLibrary.jar') compile files('libs/androidplot-core-0.5.0-release.jar') - implementation (group: 'com.shimmersensing', name: 'ShimmerBluetoothManager', version:'0.9.42beta'){ + implementation (group: 'com.shimmerresearch', name: 'shimmerbluetoothmanager', version:'0.10.0_alpha'){ // excluding org.json which is provided by Android exclude group: 'io.netty' exclude group: 'com.google.protobuf' exclude group: 'org.apache.commons.math' } - implementation (group: 'com.shimmersensing', name: 'ShimmerDriver', version:'0.9.138beta'){ + implementation (group: 'com.shimmerresearch', name: 'shimmerdriver', version:'0.10.0_alpha'){ // excluding org.json which is provided by Android exclude group: 'io.netty' exclude group: 'com.google.protobuf' diff --git a/ShimmerAndroidInstrumentDriver/build.gradle b/ShimmerAndroidInstrumentDriver/build.gradle index b6fe345a..06427e0b 100644 --- a/ShimmerAndroidInstrumentDriver/build.gradle +++ b/ShimmerAndroidInstrumentDriver/build.gradle @@ -25,8 +25,12 @@ allprojects { repositories { google() maven { - url "https://shimmersensing.jfrog.io/artifactory/ShimmerAPI" - + name = "GitHubPackages" + url = uri("https://maven.pkg.github.com/ShimmerEngineering/Shimmer-Java-Android-API") + credentials { + username = "useyourowncredentialshere" + password = "useyourowncredentialshere" + } } mavenCentral() mavenLocal() diff --git a/ShimmerAndroidInstrumentDriver/shimmerServiceExample/build.gradle b/ShimmerAndroidInstrumentDriver/shimmerServiceExample/build.gradle index 86c12c99..810db5bb 100644 --- a/ShimmerAndroidInstrumentDriver/shimmerServiceExample/build.gradle +++ b/ShimmerAndroidInstrumentDriver/shimmerServiceExample/build.gradle @@ -41,13 +41,13 @@ android { dependencies { compile project(':ShimmerAndroidInstrumentDriver') - implementation (group: 'com.shimmersensing', name: 'ShimmerBluetoothManager', version:'0.9.42beta'){ + implementation (group: 'com.shimmerresearch', name: 'shimmerbluetoothmanager', version:'0.10.0_alpha'){ // excluding org.json which is provided by Android exclude group: 'io.netty' exclude group: 'com.google.protobuf' exclude group: 'org.apache.commons.math' } - implementation (group: 'com.shimmersensing', name: 'ShimmerDriver', version:'0.9.138beta'){ + implementation (group: 'com.shimmerresearch', name: 'shimmerdriver', version:'0.10.0_alpha'){ // excluding org.json which is provided by Android exclude group: 'io.netty' exclude group: 'com.google.protobuf' From 63fa4a9dd16b6eeae9709d72902a666f5823bb5c Mon Sep 17 00:00:00 2001 From: JongChern Date: Mon, 24 Jul 2023 14:26:31 +0800 Subject: [PATCH 2/3] more updates to allow publishing and a minor fix to example --- .../build.gradle | 27 +++++++++++++++- ShimmerAndroidInstrumentDriver/build.gradle | 31 +++++++------------ .../shimmerBasicExample/build.gradle | 19 ++++++++++-- .../com/shimmerbasicexample/MainActivity.java | 2 +- 4 files changed, 55 insertions(+), 24 deletions(-) diff --git a/ShimmerAndroidInstrumentDriver/ShimmerAndroidInstrumentDriver/build.gradle b/ShimmerAndroidInstrumentDriver/ShimmerAndroidInstrumentDriver/build.gradle index cf19123d..d9a2c4b5 100644 --- a/ShimmerAndroidInstrumentDriver/ShimmerAndroidInstrumentDriver/build.gradle +++ b/ShimmerAndroidInstrumentDriver/ShimmerAndroidInstrumentDriver/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'com.android.library' apply plugin: 'com.github.dcendents.android-maven' -apply plugin: 'com.jfrog.artifactory' +//apply plugin: 'com.jfrog.artifactory' apply plugin: 'maven-publish' version = '3.0.72Beta' @@ -72,6 +72,31 @@ publishing { } */ +def getArtificatId = { -> + return "ShimmerAndroidInstrumentDriver" // Replace with library name ID +} +publishing { + publications { + bar(MavenPublication) { + groupId = 'com.shimmerresearch' // Replace with your package's group/organization name + artifactId = 'shimmerandroidinstrumentdriver' // Replace with the name of your package + version = '3.1.0_alpha' // Replace with your package version + artifact("$buildDir/outputs/aar/${getArtificatId()}-release.aar") + } + } + + repositories { + maven { + name = "GitHubPackages" + url = uri("https://maven.pkg.github.com/ShimmerEngineering/ShimmerAndroidAPI") + credentials { + username = "useyourowncredentialshere" + password = "useyourowncredentialshere" + } + } + } +} + dependencies { compile 'com.google.guava:guava:20.0' compile 'java3d:vecmath:1.3.1' diff --git a/ShimmerAndroidInstrumentDriver/build.gradle b/ShimmerAndroidInstrumentDriver/build.gradle index 06427e0b..b5569ec4 100644 --- a/ShimmerAndroidInstrumentDriver/build.gradle +++ b/ShimmerAndroidInstrumentDriver/build.gradle @@ -11,14 +11,15 @@ buildscript { classpath 'com.android.tools.build:gradle:3.5.4' classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath('org.jfrog.buildinfo:build-info-extractor-gradle:4.21.0') + //classpath('org.jfrog.buildinfo:build-info-extractor-gradle:4.21.0') } } // Plugin used to upload authenticated files to BinTray through Gradle -plugins { +/*plugins { id "com.jfrog.artifactory" version "4.21.0" } apply plugin: 'com.jfrog.artifactory' +*/ apply plugin: 'maven-publish' allprojects { @@ -32,6 +33,14 @@ allprojects { password = "useyourowncredentialshere" } } + maven { + name = "GitHubPackages" + url = uri("https://maven.pkg.github.com/ShimmerEngineering/ShimmerAndroidAPI") + credentials { + username = "useyourowncredentialshere" + password = "useyourowncredentialshere" + } + } mavenCentral() mavenLocal() } @@ -61,21 +70,3 @@ allprojects { // } // } } - -project('ShimmerAndroidInstrumentDriver') { - artifactoryPublish.dependsOn('build') - publishing { - publications { - ShimmerAndroidInstrumentDriver(MavenPublication) { - groupId = 'com.shimmersensing' - version = project.version - artifactId project.getName() - artifact("$buildDir/outputs/aar/ShimmerAndroidInstrumentDriver}-release.aar") - } - } - } - - artifactoryPublish { - publications(publishing.publications.ShimmerAndroidInstrumentDriver) - } -} \ No newline at end of file diff --git a/ShimmerAndroidInstrumentDriver/shimmerBasicExample/build.gradle b/ShimmerAndroidInstrumentDriver/shimmerBasicExample/build.gradle index cd9c2422..ff935146 100644 --- a/ShimmerAndroidInstrumentDriver/shimmerBasicExample/build.gradle +++ b/ShimmerAndroidInstrumentDriver/shimmerBasicExample/build.gradle @@ -45,7 +45,20 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) androidTestCompile 'com.android.support:support-annotations:25.3.1' - compile(group: 'com.shimmersensing', name: 'ShimmerAndroidInstrumentDriver', version: '3.0.72Beta', ext: 'aar') + compile(group: 'com.shimmerresearch', name: 'shimmerandroidinstrumentdriver', version: '3.1.0_alpha', ext: 'aar') + + implementation (group: 'com.shimmerresearch', name: 'shimmerbluetoothmanager', version:'0.10.0_alpha'){ + // excluding org.json which is provided by Android + exclude group: 'io.netty' + exclude group: 'com.google.protobuf' + exclude group: 'org.apache.commons.math' + } + implementation (group: 'com.shimmerresearch', name: 'shimmerdriver', version:'0.10.0_alpha'){ + // excluding org.json which is provided by Android + exclude group: 'io.netty' + exclude group: 'com.google.protobuf' + exclude group: 'org.apache.commons.math' + } // implementation (group: 'com.shimmersensing', name: 'ShimmerBluetoothManager', version:'0.9.42beta'){ // // excluding org.json which is provided by Android // exclude group: 'io.netty' @@ -58,13 +71,15 @@ dependencies { // exclude group: 'com.google.protobuf' // exclude group: 'org.apache.commons.math' // } - +/* implementation (group: 'com.shimmersensing', name: 'ShimmerDriverDev', version:'JA-79 v0.1'){ // excluding org.json which is provided by Android exclude group: 'io.netty' exclude group: 'com.google.protobuf' exclude group: 'org.apache.commons.math' } + + */ implementation 'com.android.support.constraint:constraint-layout:1.0.2' testImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test:runner:1.0.1' diff --git a/ShimmerAndroidInstrumentDriver/shimmerBasicExample/src/main/java/shimmerresearch/com/shimmerbasicexample/MainActivity.java b/ShimmerAndroidInstrumentDriver/shimmerBasicExample/src/main/java/shimmerresearch/com/shimmerbasicexample/MainActivity.java index a01fc911..30227b64 100644 --- a/ShimmerAndroidInstrumentDriver/shimmerBasicExample/src/main/java/shimmerresearch/com/shimmerbasicexample/MainActivity.java +++ b/ShimmerAndroidInstrumentDriver/shimmerBasicExample/src/main/java/shimmerresearch/com/shimmerbasicexample/MainActivity.java @@ -148,7 +148,7 @@ public void handleMessage(Message msg) { case CONNECTED: if(shimmer.getFirmwareVersionCode() >= 8){ if(!spinner.isEnabled()){ - switch(shimmer.getBtCommsCrcModeIfFwSupported()) { + switch(shimmer.getCurrentBtCommsCrcMode()) { case OFF: spinner.setSelection(0); break; From 2cb48bb5cfa145af67b53bdc1f3ea18d0625fe6f Mon Sep 17 00:00:00 2001 From: JongChern Date: Fri, 28 Jul 2023 13:41:01 +0800 Subject: [PATCH 3/3] minor --- .../ShimmerAndroidInstrumentDriver/build.gradle | 5 +++-- ShimmerAndroidInstrumentDriver/build.gradle | 10 ++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/ShimmerAndroidInstrumentDriver/ShimmerAndroidInstrumentDriver/build.gradle b/ShimmerAndroidInstrumentDriver/ShimmerAndroidInstrumentDriver/build.gradle index d9a2c4b5..dd244054 100644 --- a/ShimmerAndroidInstrumentDriver/ShimmerAndroidInstrumentDriver/build.gradle +++ b/ShimmerAndroidInstrumentDriver/ShimmerAndroidInstrumentDriver/build.gradle @@ -90,8 +90,9 @@ publishing { name = "GitHubPackages" url = uri("https://maven.pkg.github.com/ShimmerEngineering/ShimmerAndroidAPI") credentials { - username = "useyourowncredentialshere" - password = "useyourowncredentialshere" + /**Create github.properties in root project folder file with gpra.usr=GITHUB_USER_ID & gpra.key=PERSONAL_ACCESS_TOKEN**/ + username = githubProperties['gpra.usr'] ?: System.getenv("GPRA_USER") + password = githubProperties['gpra.key'] ?: System.getenv("GPRA_API_KEY") } } } diff --git a/ShimmerAndroidInstrumentDriver/build.gradle b/ShimmerAndroidInstrumentDriver/build.gradle index b5569ec4..1a8c50a3 100644 --- a/ShimmerAndroidInstrumentDriver/build.gradle +++ b/ShimmerAndroidInstrumentDriver/build.gradle @@ -29,16 +29,18 @@ allprojects { name = "GitHubPackages" url = uri("https://maven.pkg.github.com/ShimmerEngineering/Shimmer-Java-Android-API") credentials { - username = "useyourowncredentialshere" - password = "useyourowncredentialshere" + /**Create github.properties in root project folder file with gpr.usr=GITHUB_USER_ID & gpr.key=PERSONAL_ACCESS_TOKEN**/ + username = githubProperties['gpr.usr'] ?: System.getenv("GPR_USER") + password = githubProperties['gpr.key'] ?: System.getenv("GPR_API_KEY") } } maven { name = "GitHubPackages" url = uri("https://maven.pkg.github.com/ShimmerEngineering/ShimmerAndroidAPI") credentials { - username = "useyourowncredentialshere" - password = "useyourowncredentialshere" + /**Create github.properties in root project folder file with gpr.usr=GITHUB_USER_ID & gpr.key=PERSONAL_ACCESS_TOKEN**/ + username = githubProperties['gpr.usr'] ?: System.getenv("GPR_USER") + password = githubProperties['gpr.key'] ?: System.getenv("GPR_API_KEY") } } mavenCentral()