Skip to content
This repository has been archived by the owner on Mar 5, 2023. It is now read-only.

Commit

Permalink
[#752] Simplify build.gradle file (#754)
Browse files Browse the repository at this point in the history
Simplify the build.gradle file by removing unnecessary/unused stuff, and
standardizing the code style.
  • Loading branch information
pyokagan committed Dec 9, 2017
2 parents 63a82f5 + c205d6f commit 0ade250
Showing 1 changed file with 35 additions and 67 deletions.
102 changes: 35 additions & 67 deletions build.gradle
Expand Up @@ -6,6 +6,9 @@
*/

plugins {
id 'java'
id 'jacoco'
id 'checkstyle'
id "com.github.kt3k.coveralls" version "2.4.0"
id "com.github.johnrengelman.shadow" version '1.2.3'
id 'org.asciidoctor.convert' version '1.5.3'
Expand All @@ -15,82 +18,48 @@ plugins {
// Specifies the entry point of the application
mainClassName = 'seedu.address.MainApp'

allprojects {
apply plugin: 'idea'
apply plugin: 'java'
apply plugin: 'jacoco'
apply plugin: 'checkstyle'
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

repositories {
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
checkstyle {
toolVersion = '8.1'
}

repositories {
jcenter()
mavenCentral()
maven { url "https://repo.eclipse.org/content/repositories/egit-releases/" }
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
jacocoTestReport {
reports {
xml.enabled false
csv.enabled false
html.destination "${buildDir}/jacocoHtml"
}
}

// This part is similar to global variables
// Access them by using double-quoted strings (GStrings) and referencing by $ e.g. "Variable contains $Variable"
project.ext {
controlsFxVersion = '8.40.11'
guavaVersion = '19.0'
jacksonVersion = '2.7.0'
jacksonDataTypeVersion = '2.7.4'
junitVersion = '4.12'
testFxVersion = '4.0.7-alpha'
monocleVersion = '1.8.0_20'
checkstyleVersion = '8.1'

libDir = 'lib'
}
dependencies {
String testFxVersion = '4.0.7-alpha'

checkstyle {
toolVersion = "$checkstyleVersion"
}
compile group: 'org.fxmisc.easybind', name: 'easybind', version: '1.0.3'
compile group: 'org.controlsfx', name: 'controlsfx', version: '8.40.11'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.7.0'
compile group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jsr310', version: '2.7.4'
compile group: 'com.google.guava', name: 'guava', version: '19.0'

jacocoTestReport {
reports {
xml.enabled false
csv.enabled false
html.destination "${buildDir}/jacocoHtml"
}
}

dependencies {
compile group: 'org.fxmisc.easybind', name: 'easybind', version: '1.0.3'
compile "org.controlsfx:controlsfx:$controlsFxVersion"
compile "com.fasterxml.jackson.core:jackson-databind:$jacksonVersion"
compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jacksonDataTypeVersion"
compile "com.google.guava:guava:$guavaVersion"

testCompile "junit:junit:$junitVersion"
testCompile "org.testfx:testfx-core:$testFxVersion"
testCompile "org.testfx:testfx-junit:$testFxVersion"
testCompile "org.testfx:testfx-legacy:$testFxVersion", {
exclude group: "junit", module: "junit"
}
testCompile "org.testfx:openjfx-monocle:$monocleVersion"
}

sourceSets {
main {
java {
srcDir 'src/main/java'
}
resources {
srcDir 'src/main/resources'
}
}
testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile group: 'org.testfx', name: 'testfx-core', version: testFxVersion
testCompile group: 'org.testfx', name: 'testfx-junit', version: testFxVersion
testCompile group: 'org.testfx', name: 'testfx-legacy', version: testFxVersion, {
exclude group: 'junit', module: 'junit'
}
testCompile group: 'org.testfx', name: 'openjfx-monocle', version: '1.8.0_20'
}

shadowJar {
archiveName = "addressbook.jar"
shadowJar {
archiveName = "addressbook.jar"

destinationDir = file("${buildDir}/jar/")
}
destinationDir = file("${buildDir}/jar/")
}

task wrapper(type: Wrapper) {
Expand Down Expand Up @@ -124,7 +93,6 @@ tasks.coveralls {

class AddressBookTest extends Test {
public AddressBookTest() {
forkEvery = 1
systemProperty 'testfx.setup.timeout', '60000'

/*
Expand Down

0 comments on commit 0ade250

Please sign in to comment.