Gradle: separate from aion repo and build scripts #60
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
lib/maven_repo
that will have a Maven repo dir structure, so aion_api can use it as a Maven repoDetails of how jar and pom were added:
Short version: From a cloned
aion
repo, run:./gradlew :modAionBase:publish :modCrypto:publish :modLogger:publish :modRlp:publish :3rdParty.libnzmq:publish :aion_vm_api:publish :modUtil:publish -PpublishTarget=/home/you/path_to/aion_api/lib/maven_repo
That basically runs publish for a bunch of kernel modules we specifically name in the command. The modules we named are the ones we added in build.gradle (modAionBase, modCrypto, modLogger, modRlp, libnzmq), plus all transitive dependencies (modUtil, aion_vm_api).
Long version
After updating build.gradle in aion_api, if you build, it will tell you that it can't find the dependencies, since modAionBAse, modLogger, etc are not in a Maven Central repo. This command can be run for a nicer view of missing dependencies:
So in kernel, we use the
publish
target of the missing dependencies and tell Gradle to write it to aion_api's maven repo dir:If we try to build aion_api again, there's new missing dependencies. That's because the kernel modules we just published have dependencies on other kernel modules.
So, we go back to the kernel and publish those ones as well (
./gradlew :aion_vm_api:publish :modUtil:publish -PpublishTarget=/home/sergiu/repos/aion_api/lib/maven_repo
). After that, aion_api can build.Testing
I've tested the output jar of pack build against Aion Wallet (replaced its aion_api jar with the one produced by this code) and it appears to function fine on Linux. Note: still need to add Mac and Windows support to libnzmq before we update Aion Wallet jars with these new ones.