Skip to content

Commit

Permalink
Refactor gradle build files to use common variables
Browse files Browse the repository at this point in the history
  • Loading branch information
aecio committed Mar 5, 2023
1 parent 5c805b1 commit 0038e89
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 40 deletions.
22 changes: 7 additions & 15 deletions ache-tools/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,14 @@ plugins {
mainClassName = 'achecrawler.RunCliTool'
applicationDefaultJvmArgs = ["-Dname=ache-tools -XX:+HeapDumpOnOutOfMemoryError"]

repositories {
mavenCentral()
}

dependencies {
// Sub-projects
implementation project(':ache')
implementation project(':crawler-commons')

// Dependencies
implementation group: 'org.slf4j', name: 'slf4j-api', version: '1.7.+'
implementation group: 'ch.qos.logback', name: 'logback-classic', version: '1.4.+'
implementation libraries.slf4j_api
implementation libraries.logback
implementation group: 'org.apache.commons', name: 'commons-compress', version: '1.21'
implementation group: 'commons-validator', name: 'commons-validator', version: '1.6'
implementation group: 'io.airlift', name: 'airline', version: '0.9'
Expand All @@ -30,12 +26,8 @@ dependencies {
implementation group: 'com.amazonaws', name: 'aws-java-sdk-s3', version: '1.12.+'

// Test framework dependencies
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.2'
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.9.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.2'
testImplementation group: 'org.assertj', name: 'assertj-core', version: '3.24.2'
}

test {
useJUnitPlatform()
}
testImplementation libraries.junit_jupiter_api
testImplementation libraries.junit_jupiter_params
testRuntimeOnly libraries.junit_jupiter_engine
testImplementation libraries.assertj_core
}
39 changes: 17 additions & 22 deletions ache/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,22 @@ plugins {
id 'com.github.kt3k.coveralls' version '2.12.0'
}

sourceCompatibility = 1.8
targetCompatibility = 1.8
compileJava.options.encoding = "UTF-8"
version = '0.15.0-SNAPSHOT'
mainClassName = 'achecrawler.Main'
applicationDefaultJvmArgs = ["-Dname=ache -XX:+UseConcMarkSweepGC -XX:+HeapDumpOnOutOfMemoryError"]

repositories {
mavenCentral()
}
ext.versions = [
com_fasterxml_jackson: '2.14.2',
io_dropwizard_metrics: '4.2.17',
]

dependencies {
// Sub-projects
implementation project(':crawler-commons')
// Logging
implementation group: 'org.slf4j', name: 'slf4j-api', version: '1.7.36'
implementation group: 'ch.qos.logback', name: 'logback-classic', version: '1.4.5'
implementation libraries.slf4j_api
implementation libraries.logback
// Commons
implementation group: 'com.google.guava', name: 'guava', version: '23.0'
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0'
Expand All @@ -33,17 +32,17 @@ dependencies {
// CLI
implementation group: 'io.airlift', name: 'airline', version: '0.9'
// Data serialization
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.14.2'
implementation group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-cbor', version: '2.14.2'
implementation group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-yaml', version: '2.14.2'
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: versions.com_fasterxml_jackson
implementation group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-cbor', version: versions.com_fasterxml_jackson
implementation group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-yaml', version: versions.com_fasterxml_jackson
implementation group: 'com.esotericsoftware', name: 'kryo', version: '4.0.2'
implementation group: 'de.javakaffee', name: 'kryo-serializers', version: '0.43'
// REST server dependencies
implementation group: 'io.javalin', name: 'javalin', version: '4.2.0'
// Metrics and monitoring
implementation group: 'io.dropwizard.metrics', name: 'metrics-core', version: '4.2.17'
implementation group: 'io.dropwizard.metrics', name: 'metrics-json', version: '4.2.17'
implementation group: 'io.dropwizard.metrics', name: 'metrics-jvm', version: '4.2.17'
implementation group: 'io.dropwizard.metrics', name: 'metrics-core', version: versions.io_dropwizard_metrics
implementation group: 'io.dropwizard.metrics', name: 'metrics-json', version: versions.io_dropwizard_metrics
implementation group: 'io.dropwizard.metrics', name: 'metrics-jvm', version: versions.io_dropwizard_metrics
// Data management and repositories
implementation group: 'org.rocksdb', name: 'rocksdbjni', version: '6.25.3'
implementation group: 'org.elasticsearch.client', name: 'elasticsearch-rest-client', version: '5.6.7'
Expand All @@ -68,15 +67,11 @@ dependencies {
implementation files('libs/jsonic-1.2.0.jar') // required by by langdetect-03-03-2014.jar

// Test framework dependencies
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.2'
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.9.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.2'
testImplementation group: 'org.assertj', name: 'assertj-core', version: '3.24.2'
testImplementation group: 'org.mockito', name: 'mockito-core', version: '5.1.1'
}

test {
useJUnitPlatform()
testImplementation libraries.junit_jupiter_api
testImplementation libraries.junit_jupiter_params
testRuntimeOnly libraries.junit_jupiter_engine
testImplementation libraries.mockito
testImplementation libraries.assertj_core
}

//
Expand Down
28 changes: 25 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,29 @@ plugins {
id 'java'
}

repositories {
mavenCentral()
}
subprojects {

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

repositories {
mavenCentral()
}

test {
useJUnitPlatform()
}

// Dependencies used by multiple sub-projects
ext.libraries = [
// testing
junit_jupiter_api: [group: "org.junit.jupiter", name: "junit-jupiter-api", version: "5.9.2"],
junit_jupiter_params: [group: "org.junit.jupiter", name: "junit-jupiter-params", version: "5.9.2"],
junit_jupiter_engine: [group: "org.junit.jupiter", name: "junit-jupiter-engine", version: "5.9.2"],
assertj_core: [group: "org.assertj", name: "assertj-core", version: "3.20.2"],
mockito: [group: "org.mockito", name: "mockito-core", version: "5.1.1"],
// logging
slf4j_api: [group: 'org.slf4j', name: 'slf4j-api', version: '2.0.6'],
logback: [group: 'ch.qos.logback', name: 'logback-classic', version: '1.4.5'],
]
}

0 comments on commit 0038e89

Please sign in to comment.