diff --git a/CSE1105.checkstyle.xml b/CSE1105.checkstyle.xml deleted file mode 100644 index d0fe4b0..0000000 --- a/CSE1105.checkstyle.xml +++ /dev/null @@ -1,188 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build.gradle b/build.gradle index e91d569..2b6ed72 100644 --- a/build.gradle +++ b/build.gradle @@ -16,44 +16,16 @@ apply plugin: 'eclipse' apply plugin: 'idea' apply plugin: 'org.springframework.boot' apply plugin: 'io.spring.dependency-management' -apply plugin: 'jacoco' -apply plugin: 'checkstyle' apply plugin: 'application' application { mainClassName = 'greenify.server.Application' } -tasks.withType(Checkstyle) { - reports { - html.destination rootProject.file("build/reports/checkstyle.html") - } -} - repositories { mavenCentral() } -allprojects { - task hello { - doLast { task -> - println "I'm $task.project.name" - } - } -} - -////client bootjar -//bootJar { -// baseName = 'gs-consuming-rest' -// version = '0.1.0' -//} -// -////server bootjar -//bootJar { -// baseName = 'gs-rest-service' -// version = '0.1.0' -//} - bootJar { enabled = false } @@ -65,10 +37,6 @@ jar { sourceCompatibility = 1.8 targetCompatibility = 1.8 -test { - useJUnitPlatform() -} - dependencies { compile("org.springframework.boot:spring-boot-starter") compile("org.springframework:spring-web") @@ -90,22 +58,6 @@ dependencies { ) } -jacoco { - toolVersion = "0.8.3" - reportsDir = file("$buildDir/customJacocoReportDir") -} - -jacocoTestReport { - reports { - xml.enabled false - csv.enabled false - html.destination file("${buildDir}/jacocoHtml") - } -} - -task application(type: JavaExec, dependsOn: classes) { - main = 'Cient.Application' -} diff --git a/quality/checkstyle/checkstyle.xml b/quality/checkstyle/checkstyle.xml new file mode 100644 index 0000000..905d05c --- /dev/null +++ b/quality/checkstyle/checkstyle.xml @@ -0,0 +1,188 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/quality/checkstyle/suppression.xml b/quality/checkstyle/suppression.xml new file mode 100644 index 0000000..32fd9c0 --- /dev/null +++ b/quality/checkstyle/suppression.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/Client/build.gradle b/src/Client/build.gradle index 9b01f2b..61f1dea 100644 --- a/src/Client/build.gradle +++ b/src/Client/build.gradle @@ -13,32 +13,27 @@ apply plugin: 'idea' apply plugin: 'org.springframework.boot' apply plugin: 'io.spring.dependency-management' apply plugin: 'jacoco' -//apply plugin: 'checkstyle' -// -//checkstyle { -// version = '7.8.1' -// config = 'checkstyle/checkstyle.xml' as File -//} -// -//checkstyleMain { -// source ='src/main/java' -//} -// -//checkstyleTest { -// source ='src/test/java' -//} -// -//tasks.withType(Checkstyle) { -// reports { -// xml.enabled false -// html.enabled true -// html.stylesheet resources.text.fromFile('config/xsl/checkstyle-custom.xsl') -// } -//} +apply plugin: 'checkstyle' sourceCompatibility = 1.8 targetCompatibility = 1.8 +def configDir = "${project.rootDir}/quality" + +checkstyle { + toolVersion '7.8.1' + configFile file("$configDir/checkstyle/checkstyle.xml") + configProperties.checkstyleSuppressionsPath = file("$configDir/checkstyle/suppressions.xml").absolutePath +} + +checkstyleMain { + source ='src/main/java' +} + +checkstyleTest { + source ='src/test/java' +} + test { useJUnitPlatform() } diff --git a/src/Common/build.gradle b/src/Common/build.gradle index a903381..f43cd70 100644 --- a/src/Common/build.gradle +++ b/src/Common/build.gradle @@ -11,6 +11,7 @@ apply plugin: 'java' apply plugin: 'eclipse' apply plugin: 'idea' apply plugin: 'jacoco' +apply plugin: 'checkstyle' sourceCompatibility = 1.8 targetCompatibility = 1.8 @@ -19,6 +20,22 @@ repositories { mavenCentral() } +def configDir = "${project.rootDir}/quality" + +checkstyle { + toolVersion '7.8.1' + configFile file("$configDir/checkstyle/checkstyle.xml") + configProperties.checkstyleSuppressionsPath = file("$configDir/checkstyle/suppressions.xml").absolutePath +} + +checkstyleMain { + source ='src/main/java' +} + +checkstyleTest { + source ='src/test/java' +} + dependencies { testCompile("junit:junit") testCompile( diff --git a/src/Server/build.gradle b/src/Server/build.gradle index 4d1b88a..6968ab5 100644 --- a/src/Server/build.gradle +++ b/src/Server/build.gradle @@ -13,6 +13,7 @@ apply plugin: 'idea' apply plugin: 'org.springframework.boot' apply plugin: 'io.spring.dependency-management' apply plugin: 'jacoco' +apply plugin: 'checkstyle' bootJar { baseName = 'gs-rest-service' @@ -31,6 +32,22 @@ repositories { sourceCompatibility = 1.8 targetCompatibility = 1.8 +def configDir = "${project.rootDir}/quality" + +checkstyle { + toolVersion '7.8.1' + configFile file("$configDir/checkstyle/checkstyle.xml") + configProperties.checkstyleSuppressionsPath = file("$configDir/checkstyle/suppressions.xml").absolutePath +} + +checkstyleMain { + source ='src/main/java' +} + +checkstyleTest { + source ='src/test/java' +} + dependencies { compile("org.springframework.boot:spring-boot-starter-web") testCompile('org.springframework.boot:spring-boot-starter-test')