Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
193 lines (165 sloc) 4.59 KB
buildscript {
repositories {
mavenLocal()
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath "com.github.jengelman.gradle.plugins:shadow:2.0.4"
}
}
// Artifact publishing and versoning
plugins {
id 'nebula.release' version '6.0.2'
id "nebula.project" version "3.4.0"
id "nebula.maven-base-publish" version "5.1.4"
id "org.sonarqube" version "2.6.2"
}
allprojects {
//Shadow for fat-jars
apply plugin: "com.github.johnrengelman.shadow"
//IDE
apply plugin: "java"
apply plugin: "eclipse"
apply plugin: "idea"
//Other
apply plugin: "maven"
apply plugin: "jacoco"
apply plugin: "signing"
//Nebula
apply plugin: 'nebula.project'
apply plugin: 'nebula.nebula-release'
apply plugin: 'nebula.maven-base-publish'
//Java version
sourceCompatibility = 1.8
targetCompatibility = 1.8
//Project properties
project.group = 'org.api4'
project.version = '0.0.1'
ext {
ossrhUsername = hasProperty('ossrhUsername') ? ossrhUsername : System.getenv("ossrhUsername")
ossrhPassword = hasProperty('ossrhPassword') ? ossrhPassword : System.getenv("ossrhPassword")
}
sourceSets {
main {
java {
srcDir 'src/main/java'
}
resources {
srcDir 'conf'
srcDir 'resources'
}
}
test {
java {
srcDir 'src/test/java'
srcDir 'src/example/java'
}
}
}
//Repositories
repositories {
mavenCentral()
mavenLocal()
maven { url "https://jitpack.io" }
maven { url "http://clojars.org/repo/" }
maven { url "https://plugins.gradle.org/m2/" }
maven { url "https://nexus.cs.upb.de/repository/maven-releases/" }
flatDir {
dirs 'lib'
}
}
//Dependencies for all(!) projects
dependencies {
// configuration
compile group: 'org.aeonbits.owner', name: 'owner-java8', version:'1.0.10'
// event bus
compile group: 'com.google.guava', name: 'guava', version: '27.0-jre'
//Logger
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
runtimeOnly group: 'org.slf4j', name:'slf4j-log4j12', version:'1.7.25'
//Testing
testCompile group: 'junit', name: 'junit', version: '4.12'
//testCompile group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.4.0-M1'
testCompile group: 'org.hamcrest', name: 'hamcrest-all', version: '1.3'
testCompile group: 'org.mockito', name: 'mockito-all', version: '1.10.19'
}
//Always check for updates in SNAPSHOT versions, do not cache
configurations.all {
// check for updates every build
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
exclude module: 'all'
}
//Nebula releases
nebulaRelease { addReleaseBranchPattern('/dev/') }
//Sonarqube config
sonarqube {
properties {
properties["sonar.projectKey"] = "starlibs.ailibs"
properties["sonar.projectName"] = project.name
properties["sonar.projectDescription"] = project.description
properties["sonar.projectVersion"] = project.version
properties["sonar.projectBaseDir"] = project.projectDir
properties["sonar.working.directory"] = "$project.buildDir/sonar"
properties["sonar.sourceEncoding"] = project.compileJava.options.encoding
properties["sonar.java.source"] = project.sourceCompatibility
properties["sonar.java.target"] = project.targetCompatibility
properties["sonar.java.binaries"] = sourceSets.main.output.classesDir
properties["sonar.java.test.binaries"] = sourceSets.test.output.classesDir
}
}
publishing {
publications {
shadow(MavenPublication) { publication ->
project.shadow.component(publication)
}
}
repositories {
maven {
url "${nexusBaseUrl}/repository/${nexusUpRepo}-${'snapshots'}"
credentials {
username "${nexusUser}"
password "${nexusPassword}"
}
}
}
}
// This task creates a jar with test classes.
task testClassesJar(type: Jar) {
classifier = 'tests'
from sourceSets.test.output
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
// Add a new configuration named testArtifacts
configurations {
testArtifacts
}
artifacts {
testArtifacts testClassesJar
archives sourcesJar, javadocJar
}
// generate JavaDoc for each project
task generateJavadoc(type: Javadoc) {
source = sourceSets.main.allJava
classpath = files(sourceSets.main.compileClasspath)
destinationDir = file("docs/javadoc")
// failOnError = true
}
signing {
sign configurations.archives
}
}
dependencies{
compile project(":common")
compile project(":algorithm")
compile project(":datastructure")
compile project(":ai.ml")
compile project(":ai.graphsearch")
}
test{
maxHeapSize = "4g"
}
publish.dependsOn shadowJar
You can’t perform that action at this time.