Step 1. Add the JitPack repository to your build file
Add it in your root settings.gradle at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Add it in your settings.gradle.kts at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}
Add to pom.xml
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Add it in your build.sbt at the end of resolvers:
resolvers += "jitpack" at "https://jitpack.io"
Add it in your project.clj at the end of repositories:
:repositories [["jitpack" "https://jitpack.io"]]
Step 2. Add the dependency
dependencies {
implementation 'com.github.SerproLivre:cordova-android-library:0.0.3'
}
dependencies {
implementation("com.github.SerproLivre:cordova-android-library:0.0.3")
}
<dependency>
<groupId>com.github.SerproLivre</groupId>
<artifactId>cordova-android-library</artifactId>
<version>0.0.3</version>
</dependency>
libraryDependencies += "com.github.SerproLivre" % "cordova-android-library" % "0.0.3"
:dependencies [[com.github.SerproLivre/cordova-android-library "0.0.3"]]
This is a apache cordova-android + plugins library android project that you can use like dependency to run cordova apps from your native android app
This project use mfdeveloper/android-fat-aar (a fork off adwiv/android-fat-aar) that contains custom gradle tasks,
to generate a .aar
file with all cordova android core
dependencies from cordova.6.2.3-release/framework-release.aar
, + cordova plugins stored in: cordovapackage/src/main/java
Install Java 8
Click on View > Tool Windows > Gradle
(or click Gradle in the tool window bar)
search
:cordovapackage > Tasks > build
and run assembleRelease
task.
See Monitor the build process documentation
The
cordovapackage-release.aar
file will be generated on:build/outputs/aar
folder
sudo apt-get install gradle
gradle assembleRelease
PS: The file cordovapackage-release.aar will be generated in:
cordovapackage/build/outputs/aar
cordovapackage-release.aar
into your android native project from File > New Module > Import .JAR/.AAR package
buil.gradle
like this:compile project(':my-cordova-library')
Or use like a Jitpack dependency into your(s) build.gradle
file(s):
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'com.github.SerproLivre:cordova-android-library:0.0.2'
}
For while, create a issue or submit a PR with the new cordova-plugins you wish to generate a .aar
file
with this. In future, the extra plugins can be added more dinamically :)
Michel Felipe michel.ferreira@serpro.gov.br