Skip to content

Commit 17898ec

Browse files
author
Stewart Miles
committed
Script that generates maven packages for a set of local files.
file_to_maven_package.gradle will create a local Maven repository for packages that are not found in a set of remote Maven repositories (currently Maven Central and Google Maven). Packages that are found in the remote repositories are simply printed to the standard output. Over half of the implementation is an indexer for Google Maven that incrementally indexes the repository and stores the index in a local JSON file. A cache of the index will eventually be hosted on github and updated periodically to speed up the process of indexing the repository. The script exposes the top level tasks: * install: Creates a local maven repo of supplied input libraries and looks for libraries in remote repos printing the results to the standard output. * updateGoogleMavenIndex: Intended to be used from the resolver's build script to update the cached index on github. * searchMavenIndexes: Searches indexed repositories for local artifacts by SHA-1 printing the matches to the standard output. For example: ./gradlew \ -b source/PlayServicesResolver/scripts/file_to_maven_package.gradle \ -PTARGET_DIR=$(pwd)/tmp \ -PGOOGLE_MAVEN_INDEX_URI=file://$(pwd)/unity-jar-resolver/index.zip \ -PFILE_TO_MAVEN_PACKAGE="\ ~/Downloads/flatbuffers-java-1.11.1.jar@\ com.google.flatbuffers:flatbuffers-java:0.0.0;\ source/PlayServicesResolver/scripts/download_artifacts_test_assets/\ m2repository/com/android/support/support-annotations/24.0.0/\ support-annotations-24.0.0.jar@\ com.android.support:support-annotations:24.0.0;\ source/PlayServicesResolver/scripts/download_artifacts_test_assets/\ m2repository/androidx/cursoradapter/cursoradapter/1.0.0/\ cursoradapter-1.0.0.aar@;\ source/PlayServicesResolver/scripts/download_artifacts_test_assets/\ m2repository/com/google/firebase/firebase-app-unity/4.3.0/\ firebase-app-unity-4.3.0.srcaar@" \ install Will read the cached Google Maven index file index.zip and incrementally update it, create a local maven repo under "tmp" and print the following output... Packages: org.psr:com.google.firebase.firebase-app-unity.4.3.0:0.0.0 file:/XXXX/unity-jar-resolver/tmp/ androidx.cursoradapter:cursoradapter:1.0.0 https://dl.google.com/dl/android/maven2/ com.android.support:support-annotations:24.0.0 https://dl.google.com/dl/android/maven2/ com.google.flatbuffers:flatbuffers-java:1.11.1 https://repo.maven.apache.org/maven2/ Bug: 135269831, 135273820 Change-Id: I6991a114480d8c76d4aeb160b83ac719c14bee55
1 parent 3e23740 commit 17898ec

File tree

1 file changed

+1645
-0
lines changed

1 file changed

+1645
-0
lines changed

0 commit comments

Comments
 (0)