Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gradle: separate from aion repo and build scripts #60

Merged
merged 6 commits into from
Feb 14, 2019
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
149 changes: 49 additions & 100 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@ repositories {
mavenLocal()
mavenCentral()
jcenter()
maven { url "https://dl.bintray.com/aionjayt/aion_api" }
flatDir { dirs './lib', './mod' }
maven {
url "https://dl.bintray.com/aionjayt/aion_api"
url "${rootDir}/lib/maven_repo"
}
flatDir { dirs './lib' }
}

ext.moduleName = 'aion.api.client'
Expand Down Expand Up @@ -54,68 +57,59 @@ sourceSets {
}
}

if (rootProject.name != AION_PROJECT_NAME) {
afterEvaluate {
// Override java plug-in behaviour to make JDK9+ module logic work
// From: https://guides.gradle.org/building-java-9-modules/#step_2_produce_java_9_modules_for_all_subprojects
compileJava {
inputs.property("moduleName", moduleName)
doFirst {
options.compilerArgs = [
'--module-path', classpath.asPath,
]
classpath = files()
}
afterEvaluate {
// Override java plug-in behaviour to make JDK9+ module logic work
// From: https://guides.gradle.org/building-java-9-modules/#step_2_produce_java_9_modules_for_all_subprojects
compileJava {
inputs.property("moduleName", moduleName)
doFirst {
options.compilerArgs = [
'--module-path', classpath.asPath,
]
classpath = files()
}
}

// Need to comment this out for now, modules-info.java doesn't have 'require' declarations
// used by the test code. The ant build.xml, similarly, uses module-path for build, but
// classpath for building the tests (at least in modRlp). Need to sort out how to properly set the module-path
// for the tests before using the stuff below.
/*
compileTestJava {
inputs.property("moduleName", moduleName)
doFirst {
options.compilerArgs = [
'--module-path', classpath.asPath,
'--add-modules', 'junit',
'--add-reads', "$moduleName=junit",
'--patch-module', "$moduleName=" + files(sourceSets.test.java.srcDirs).asPath,
]
classpath = files()
}
// Need to comment this out for now, modules-info.java doesn't have 'require' declarations
// used by the test code. The ant build.xml, similarly, uses module-path for build, but
// classpath for building the tests (at least in modRlp). Need to sort out how to properly set the module-path
// for the tests before using the stuff below.
/*
compileTestJava {
inputs.property("moduleName", moduleName)
doFirst {
options.compilerArgs = [
'--module-path', classpath.asPath,
'--add-modules', 'junit',
'--add-reads', "$moduleName=junit",
'--patch-module', "$moduleName=" + files(sourceSets.test.java.srcDirs).asPath,
]
classpath = files()
}
}

test {
inputs.property("moduleName", moduleName)
doFirst {
jvmArgs = [
'--module-path', classpath.asPath,
'--add-modules', 'ALL-MODULE-PATH',
'--add-reads', "$moduleName=junit",
'--patch-module', "$moduleName=" + files(sourceSets.test.java.outputDir).asPath,
]
classpath = files()
}
test {
inputs.property("moduleName", moduleName)
doFirst {
jvmArgs = [
'--module-path', classpath.asPath,
'--add-modules', 'ALL-MODULE-PATH',
'--add-reads', "$moduleName=junit",
'--patch-module', "$moduleName=" + files(sourceSets.test.java.outputDir).asPath,
]
classpath = files()
}
*/
}
*/
}

dependencies {
if (rootProject.name == AION_PROJECT_NAME) {
compile project(':modAionBase')
compile project(':modCrypto')
compile project(':modLogger')
compile project(':modRlp')
compile project(':3rdParty.libnzmq')
} else {
compile files("./mod/modAionBase.jar")
compile files("./mod/modCrypto.jar")
compile files("./mod/modLogger.jar")
compile files("./mod/modRlp.jar")
compile files("./lib/libnzmq.jar")
}
compile 'network.aion:modAionBase:0.3.2'
compile 'network.aion:modCrypto:0.3.2'
compile 'network.aion:modLogger:0.3.2'
compile 'network.aion:modRlp:0.3.2'
compile 'network.aion:libnzmq:1.0'

compile 'com.madgag.spongycastle:prov:1.58.0.0'
compile 'com.madgag.spongycastle:core:1.58.0.0'
compile group: 'org.apache.commons', name: 'commons-collections4', version: '4.0'
Expand Down Expand Up @@ -288,51 +282,6 @@ clean.doFirst {
delete "pack"
}

task updateAionDeps(type: Copy) {
doFirst {
if (rootProject.name != AION_PROJECT_NAME) {
throw new GradleException('Can only update kernel dependencies when calling this task with aion as the root project')
}
}

// note: dependencies of the projects aren't copied
['modAionBase', 'modCrypto', 'modLogger', 'modRlp'].each {
def maybeProj = rootProject.findProject(":${it}")
if (maybeProj != null) {
dependsOn maybeProj.jar
from maybeProj.jar.outputs
}
}
into file('mod')

}

task updateNativeDeps(type: Copy) {
doFirst {
if (rootProject.name != AION_PROJECT_NAME) {
throw new GradleException('Can only update kernel dependencies when calling this task with aion as the root project')
}
}

['3rdParty/libnzmq'].each {
def maybeProj = rootProject.findProject(":${it}")
if (maybeProj != null) {
dependsOn maybeProj.jar
from maybeProj.jar.outputs
}
}
into file('lib')
}

/**
* Update the jars in aion_api using jars from aion (kernel). Replaces ant
* target 'clean_build_from_kernel'
*/
task updateKernelDeps {
dependsOn updateAionDeps
dependsOn updateNativeDeps
}

def pomConfig = {
licenses {
license {
Expand Down
Binary file removed lib/libnzmq.jar
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>network.aion</groupId>
<artifactId>aion_vm_api</artifactId>
<version>0.3.2</version>
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.25</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
Binary file not shown.
8 changes: 8 additions & 0 deletions lib/maven_repo/network/aion/libnzmq/1.0/libnzmq-1.0.pom
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>network.aion</groupId>
<artifactId>libnzmq</artifactId>
<version>1.0</version>
</project>
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>network.aion</groupId>
<artifactId>modAionBase</artifactId>
<version>0.3.2</version>
<dependencies>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>25.1-jre</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>network.aion</groupId>
<artifactId>aion_vm_api</artifactId>
<version>0.3.2</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
Binary file not shown.
46 changes: 46 additions & 0 deletions lib/maven_repo/network/aion/modCrypto/0.3.2/modCrypto-0.3.2.pom
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>network.aion</groupId>
<artifactId>modCrypto</artifactId>
<version>0.3.2</version>
<dependencies>
<dependency>
<groupId>network.aion</groupId>
<artifactId>modUtil</artifactId>
<version>0.3.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>network.aion</groupId>
<artifactId>modRlp</artifactId>
<version>0.3.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.madgag.spongycastle</groupId>
<artifactId>prov</artifactId>
<version>1.58.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.madgag.spongycastle</groupId>
<artifactId>core</artifactId>
<version>1.58.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.25</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>25.1-jre</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
Binary file not shown.
28 changes: 28 additions & 0 deletions lib/maven_repo/network/aion/modLogger/0.3.2/modLogger-0.3.2.pom
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>network.aion</groupId>
<artifactId>modLogger</artifactId>
<version>0.3.2</version>
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.25</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>1.2.3</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.2.3</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
Binary file not shown.
34 changes: 34 additions & 0 deletions lib/maven_repo/network/aion/modRlp/0.3.2/modRlp-0.3.2.pom
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>network.aion</groupId>
<artifactId>modRlp</artifactId>
<version>0.3.2</version>
<dependencies>
<dependency>
<groupId>network.aion</groupId>
<artifactId>modUtil</artifactId>
<version>0.3.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.madgag.spongycastle</groupId>
<artifactId>prov</artifactId>
<version>1.58.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.madgag.spongycastle</groupId>
<artifactId>core</artifactId>
<version>1.58.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>25.1-jre</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
Binary file not shown.
8 changes: 8 additions & 0 deletions lib/maven_repo/network/aion/modUtil/0.3.2/modUtil-0.3.2.pom
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>network.aion</groupId>
<artifactId>modUtil</artifactId>
<version>0.3.2</version>
</project>
Binary file removed mod/modRlp.jar
Binary file not shown.