build.gradle referenced files and build logic from the aion repo -- this PR removes them
Added a dir called lib/maven_repo that will have a Maven repo dir structure, so aion_api can use it as a Maven repo
Added jar and pom files for dependencies on kernel modules into that Maven repo
Details 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:
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.
$ ./gradlew build -q
FAILURE: Build failed with an exception.
* Where:
Build file '/home/sergiu/repos/aion_api/build.gradle' line: 168
* What went wrong:
Could not determine the dependencies of task ':fatJar'.
> Could not resolve all files for configuration ':compile'.
> Could not find network.aion:aion_vm_api:0.3.2.
Searched in the following locations:
- file:/home/sergiu/.m2/repository/network/aion/aion_vm_api/0.3.2/aion_vm_api-0.3.2.pom
- file:/home/sergiu/.m2/repository/network/aion/aion_vm_api/0.3.2/aion_vm_api-0.3.2.jar
[...]
Required by:
project : > network.aion:modAionBase:0.3.2
> Could not find network.aion:modUtil:0.3.2.
Searched in the following locations:
- file:/home/sergiu/.m2/repository/network/aion/modUtil/0.3.2/modUtil-0.3.2.pom
- file:/home/sergiu/.m2/repository/network/aion/modUtil/0.3.2/modUtil-0.3.2.jar
[...]
Required by:
project : > network.aion:modCrypto:0.3.2
project : > network.aion:modRlp:0.3.2
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.
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.