The android
and the java
sample contains a simple class
with a static helloWorld()
method.
The containing build scripts (android & java) are fully setup to publish the libraries to an Artifactory.
To test this project you need a installed Artifactory instance. If you already have a installed instance somewhere you are ready to go. Just jump over this section.
if not you can simply install a Artifactory instance via Docker:
docker run --name artifactory -d -p 8081:8081 docker.bintray.io/jfrog/artifactory-oss:latest
The instance will be then available at http://localhost:8081/artifactory/.
After you have successfully setup the Artifactory you can finally publish the library project by running:
./gradlew build artifactoryPublish --init-script init.gradle.kts -PartifactoryUser=admin -PartifactoryKey=password
Note: If you have already are installed Artifactory instance you have to use your user and your API-Key instead of the Default Admin User credentials.
Now you should be able to consum the published libraries by create a new project with the following dependencies:
repositories {
maven { url "http://localhost:8081/artifactory/example-repo-local" }
}
dependencies {
implementation "guru.stefma.sample:android:0.0.1"
implementation "guru.stefma.sample:java:0.0.1"
}