78 lines
1.5 KiB
ReStructuredText
78 lines
1.5 KiB
ReStructuredText
=====
|
|
Maven
|
|
=====
|
|
|
|
* https://proandroiddev.com/tip-work-with-third-party-projects-locally-with-gradle-961d6c9efb02
|
|
* https://android.jlelse.eu/android-local-libraries-with-maven-b7456d4268cf
|
|
|
|
|
|
|
|
Maven Local (publishToMavenLocal)
|
|
----------------------------------
|
|
|
|
STEP 1:
|
|
* push to maven local
|
|
- ADD: "mavenLocal()" to --> root/main build.gradle
|
|
- make sure it is first in the list
|
|
- EXE: $ ./gradlew publishToMavenLocal
|
|
|
|
STEP 2:
|
|
* pull from maven local
|
|
- ADD: "mavenLocal()" to build.gradle
|
|
- ADD: implementation 'com.companyname.artifactname:libraryname:1.1@aar'
|
|
- ADD: implementation 'io.malloc.ccc:nc-jni:1.1@aar'
|
|
|
|
::
|
|
|
|
# push the .jar/.aar to ~/.m2/
|
|
$ gradle publishToMavenLocal
|
|
|
|
|
|
|
|
//
|
|
// this is root build.gradle
|
|
//
|
|
|
|
buildscript {
|
|
repositories {
|
|
mavenLocal()
|
|
}
|
|
}
|
|
|
|
allprojects {
|
|
repositories {
|
|
mavenLocal()
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//
|
|
// this is app LIBRARY project build.gradle
|
|
//
|
|
|
|
// we are going to "publish" to local maven repository
|
|
apply plugin: 'maven-publish'
|
|
project.afterEvaluate {
|
|
publishing {
|
|
publications {
|
|
library(MavenPublication) {
|
|
groupId 'io.malloc.ccc'
|
|
artifactId 'nc-jni'
|
|
version "1.1"
|
|
artifact(bundleReleaseAar)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//
|
|
// this is app project build.gradle
|
|
//
|
|
|
|
implementation 'com.companyname.artifactname:libraryname:1.1@aar'
|
|
implementation 'io.malloc.ccc:nc-jni:1.1@aar'
|
|
|