Skip to content

Commit

Permalink
Simplify and Refactor build.gradle files
Browse files Browse the repository at this point in the history
  • Loading branch information
drandarov-io committed Sep 21, 2017
1 parent 30873bc commit b7bc5c6
Show file tree
Hide file tree
Showing 11 changed files with 45 additions and 45 deletions.
4 changes: 2 additions & 2 deletions 00_junit_best_practice/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
dependencies {
// Main-dependency needed for JUnit 5
testCompile "org.junit.jupiter:junit-jupiter-api:${junit5_version}"
testCompile "org.junit.jupiter:junit-jupiter-api:$junit5_version"


// Commons
testCompile project(":common")


// Logging
testCompile "org.slf4j:slf4j-simple:${slf4j_version}"
testCompile "org.slf4j:slf4j-simple:$slf4j_version"
}
6 changes: 3 additions & 3 deletions 01_junit_5/build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
dependencies {
// Main-dependency needed for JUnit 5
testCompile "org.junit.jupiter:junit-jupiter-api:${junit5_version}"
testCompile "org.junit.jupiter:junit-jupiter-api:$junit5_version"


// Lagacy support for JUnit 4
testCompile "org.junit.vintage:junit-vintage-engine:${junit5_vintage4_version}"
testCompile "org.junit.vintage:junit-vintage-engine:$junit5_vintage4_version"


// Commons
testCompile project(":common")


// Logging
testCompile "org.slf4j:slf4j-simple:${slf4j_version}"
testCompile "org.slf4j:slf4j-simple:$slf4j_version"
}
8 changes: 4 additions & 4 deletions 02_assertj/build.gradle
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
dependencies {
// Main-dependency needed for JUnit 5
testCompile "org.junit.jupiter:junit-jupiter-api:${junit5_version}"
testCompile "org.junit.jupiter:junit-jupiter-api:$junit5_version"


// AssertJ
testCompile "org.assertj:assertj-core:${assertj_version}"
testCompile "org.assertj:assertj-core:$assertj_version"


// Hamcrest for comparison
testCompile "org.hamcrest:hamcrest-all:${hamcrest_version}"
testCompile "org.hamcrest:hamcrest-all:$hamcrest_version"


// Commons
testCompile project(":common")


// Logging
testCompile "org.slf4j:slf4j-simple:${slf4j_version}"
testCompile "org.slf4j:slf4j-simple:$slf4j_version"
}
14 changes: 7 additions & 7 deletions 03_spring/03_01_spring_boot_4/build.gradle
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
dependencies {
// Main-dependency needed for JUnit 5
testCompile "org.junit.jupiter:junit-jupiter-api:${junit5_version}"
testCompile "org.junit.jupiter:junit-jupiter-api:$junit5_version"

// Lagacy support for JUnit 4
testCompile "org.junit.vintage:junit-vintage-engine:${junit5_vintage4_version}"
testCompile "org.junit.vintage:junit-vintage-engine:$junit5_vintage4_version"

// Spring Boot 4
compile "org.springframework.boot:spring-boot-starter-data-jpa:${spring4_boot_version}"
testCompile "org.springframework.boot:spring-boot-starter-test:${spring4_boot_version}"
compile "org.springframework.boot:spring-boot-starter-data-jpa:$spring4_boot_version"
testCompile "org.springframework.boot:spring-boot-starter-test:$spring4_boot_version"
// JUnit 5 Extension for Spring 4 Tests
testCompile "com.github.sbrannen:spring-test-junit5:${junit5_spring4_test_version}"
testCompile "com.github.sbrannen:spring-test-junit5:$junit5_spring4_test_version"


// Commons
testCompile project(":common")

// Database Drivers
runtime "org.hsqldb:hsqldb:${hsqldb_driver_version}"
runtime "org.postgresql:postgresql:${postgresql_driver_version}"
runtime "org.hsqldb:hsqldb:$hsqldb_driver_version"
runtime "org.postgresql:postgresql:$postgresql_driver_version"
}
12 changes: 6 additions & 6 deletions 03_spring/03_02_spring_boot_5/build.gradle
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
dependencies {
// Main-dependency needed for JUnit 5
testCompile "org.junit.jupiter:junit-jupiter-api:${junit5_version}"
testCompile "org.junit.jupiter:junit-jupiter-api:$junit5_version"
// Lagacy support for JUnit 4
testCompile "org.junit.vintage:junit-vintage-engine:${junit5_vintage4_version}"
testCompile "org.junit.vintage:junit-vintage-engine:$junit5_vintage4_version"


// Spring Boot 5
compile "org.springframework.boot:spring-boot-starter-data-jpa:${spring5_boot_version}"
testCompile "org.springframework.boot:spring-boot-starter-test:${spring5_boot_version}"
compile "org.springframework.boot:spring-boot-starter-data-jpa:$spring5_boot_version"
testCompile "org.springframework.boot:spring-boot-starter-test:$spring5_boot_version"


// Commons
testCompile project(":common")


// Database Drivers
runtime "org.hsqldb:hsqldb:${hsqldb_driver_version}"
runtime "org.postgresql:postgresql:${postgresql_driver_version}"
runtime "org.hsqldb:hsqldb:$hsqldb_driver_version"
runtime "org.postgresql:postgresql:$postgresql_driver_version"
}
14 changes: 7 additions & 7 deletions 03_spring/03_03_spring_4/build.gradle
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
dependencies {
// Main-dependency needed for JUnit 5
testCompile "org.junit.jupiter:junit-jupiter-api:${junit5_version}"
testCompile "org.junit.jupiter:junit-jupiter-api:$junit5_version"
// Lagacy support for JUnit 4
testCompile "org.junit.vintage:junit-vintage-engine:${junit5_vintage4_version}"
testCompile "org.junit.vintage:junit-vintage-engine:$junit5_vintage4_version"


// Spring 4
compile "org.springframework.data:spring-data-jpa:${spring4_version}"
compile "org.springframework.data:spring-data-jpa:$spring4_version"
// JUnit 5 Extension for Spring 4 Tests
testCompile "com.github.sbrannen:spring-test-junit5:${junit5_spring4_test_version}"
testCompile "com.github.sbrannen:spring-test-junit5:$junit5_spring4_test_version"


// Hibernate JPA
compile "org.hibernate:hibernate-core:${hibernate_core_version}"
compile "org.hibernate:hibernate-core:$hibernate_core_version"


// Commons
compile project(":common")


// Database Drivers
runtime "org.hsqldb:hsqldb:${hsqldb_driver_version}"
runtime "org.postgresql:postgresql:${postgresql_driver_version}"
runtime "org.hsqldb:hsqldb:$hsqldb_driver_version"
runtime "org.postgresql:postgresql:$postgresql_driver_version"
}
14 changes: 7 additions & 7 deletions 03_spring/03_04_spring_5/build.gradle
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
dependencies {
// Main-dependency needed for JUnit 5
testCompile "org.junit.jupiter:junit-jupiter-api:${junit5_version}"
testCompile "org.junit.jupiter:junit-jupiter-api:$junit5_version"
// Lagacy support for JUnit 4
testCompile "org.junit.vintage:junit-vintage-engine:${junit5_vintage4_version}"
testCompile "org.junit.vintage:junit-vintage-engine:$junit5_vintage4_version"


// Spring 5
compile "org.springframework.data:spring-data-jpa:${spring5_data_jpa_version}"
testCompile "org.springframework:spring-test:${spring5_version}"
compile "org.springframework.data:spring-data-jpa:$spring5_data_jpa_version"
testCompile "org.springframework:spring-test:$spring5_version"


// Hibernate JPA
compile "org.hibernate:hibernate-core:${hibernate_core_version}"
compile "org.hibernate:hibernate-core:$hibernate_core_version"


// Commons
compile project(":common")


// Database Drivers
runtime "org.hsqldb:hsqldb:${hsqldb_driver_version}"
runtime "org.postgresql:postgresql:${postgresql_driver_version}"
runtime "org.hsqldb:hsqldb:$hsqldb_driver_version"
runtime "org.postgresql:postgresql:$postgresql_driver_version"
}
4 changes: 2 additions & 2 deletions 04_testfx/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
dependencies {
// Main-dependency needed for JUnit 5
testCompile "org.junit.jupiter:junit-jupiter-api:${junit5_version}"
testCompile "org.junit.jupiter:junit-jupiter-api:$junit5_version"


// Commons
testCompile project(":common")


// Logging
testCompile "org.slf4j:slf4j-simple:${slf4j_version}"
testCompile "org.slf4j:slf4j-simple:$slf4j_version"
}
6 changes: 3 additions & 3 deletions 05_mockito/build.gradle
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
dependencies {
// Main-dependency needed for JUnit 5
testCompile "org.junit.jupiter:junit-jupiter-api:${junit5_version}"
testCompile "org.junit.jupiter:junit-jupiter-api:$junit5_version"


// Mockito
testCompile "org.mockito:mockito-core:${mockito_version}"
testCompile "org.mockito:mockito-core:$mockito_version"


// Commons
testCompile project(":common")


// Logging
testCompile "org.slf4j:slf4j-simple:${slf4j_version}"
testCompile "org.slf4j:slf4j-simple:$slf4j_version"

}
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ allprojects {
}
}


configure(subprojects - project(":03_spring")) {

apply plugin: 'java'
Expand All @@ -65,7 +66,6 @@ configure(subprojects - project(":03_spring")) {

// Gradle-Configuration for JUnit 5 Platform
junitPlatform {
// platformVersion '1.0.0'
filters {
engines {
// include 'junit-jupiter', 'junit-vintage'
Expand All @@ -79,7 +79,7 @@ configure(subprojects - project(":03_spring")) {
}
}
dependencies {
testRuntime "org.junit.jupiter:junit-jupiter-engine:${junit5_version}"
testRuntime "org.junit.vintage:junit-vintage-engine:${junit5_vintage4_version}"
testRuntime "org.junit.jupiter:junit-jupiter-engine:$junit5_version"
testRuntime "org.junit.vintage:junit-vintage-engine:$junit5_vintage4_version"
}
}
2 changes: 1 addition & 1 deletion common/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dependencies {
// Hibernate JPA
compile "org.hibernate.javax.persistence:hibernate-jpa-2.1-api:${hibernate_jpa_version}"
compile "org.hibernate.javax.persistence:hibernate-jpa-2.1-api:$hibernate_jpa_version"
}

0 comments on commit b7bc5c6

Please sign in to comment.