Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion gradle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ This module contains articles about Gradle
- [Introduction to Gradle](https://www.baeldung.com/gradle)
- [Writing Custom Gradle Plugins](https://www.baeldung.com/gradle-create-plugin)
- [A Custom Task in Gradle](https://www.baeldung.com/gradle-custom-task)
- [Dependency Management in Gradle](https://www.baeldung.com/gradle-dependency-management)
10 changes: 6 additions & 4 deletions gradle/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
plugins {
id 'org.shipkit.bintray-release' version '2.3.5'
}

allprojects {
repositories {
jcenter()
mavenCentral()
}
}


subprojects {

version = '1.0'
}

Expand Down Expand Up @@ -89,4 +91,4 @@ task printJavaVersionBuildSrc(type : PrintToolVersionBuildSrcTask) {

task printGroovyVersionBuildSrc(type : PrintToolVersionBuildSrcTask) {
tool 'groovy'
}
}
4 changes: 4 additions & 0 deletions gradle/gradle-dependency-management/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### Relevant Articles:

- [Dependency Management in Gradle](https://www.baeldung.com/gradle-dependency-management)

2 changes: 1 addition & 1 deletion gradle/gradle-dependency-management/settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1 @@
rootProject.name = 'dependencymanagement'
rootProject.name = 'gradle-dependency-management'
15 changes: 7 additions & 8 deletions gradle/gradle-employee-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,30 @@ plugins {
apply plugin: 'application'
mainClassName = 'employee.EmployeeApp'

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

println 'This is executed during configuration phase'

task configured {
println 'The project is configured'
}

task wrapper(type: Wrapper){
wrapper {
gradleVersion = '5.3.1'
}

repositories {
jcenter()
mavenCentral()
}

dependencies {

compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.10'
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.10'
testImplementation('junit:junit:4.13')
testRuntime('junit:junit:4.13')
testRuntimeOnly('junit:junit:4.13')
}

test {
useJUnit()
}
Expand Down
1 change: 1 addition & 0 deletions gradle/gradle-employee-app/settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rootProject.name = 'gradle-employee-app'
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rootProject.name = 'gradle-source-vs-target-compatibility'
25 changes: 10 additions & 15 deletions gradle/gradletaskdemo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,14 @@ buildscript {
}
}
dependencies {
classpath "org.shipkit:shipkit:0.9.117"
classpath "org.shipkit:shipkit:2.3.5"
}
}


plugins {
id 'java'
}


apply from: 'aplugin.gradle'
apply plugin: 'org.shipkit.bintray-release'

Expand Down Expand Up @@ -72,8 +70,6 @@ helloBaeldung {
}




//Adding extra task properties
task ourTask {
ext.theProperty = "theValue"
Expand All @@ -86,25 +82,24 @@ task printTaskProperty {
}



//Declaring dependencies
dependencies {
compile group:
implementation group:
'org.springframework', name: 'spring-core', version: '4.3.5.RELEASE'
compile 'org.springframework:spring-core:4.3.5.RELEASE',
implementation 'org.springframework:spring-core:4.3.5.RELEASE',
'org.springframework:spring-aop:4.3.5.RELEASE'
compile(
implementation(
[group: 'org.springframework', name: 'spring-core', version: '4.3.5.RELEASE'],
[group: 'org.springframework', name: 'spring-aop', version: '4.3.5.RELEASE']
)
testCompile('org.hibernate:hibernate-core:5.2.12.Final') {
testImplementation('org.hibernate:hibernate-core:5.2.12.Final') {
transitive = true
}
runtime(group: 'org.hibernate', name: 'hibernate-core', version: '5.2.12.Final') {
runtimeOnly(group: 'org.hibernate', name: 'hibernate-core', version: '5.2.12.Final') {
transitive = false
}
runtime "org.codehaus.groovy:groovy-all:2.4.11@jar"
runtime group: 'org.codehaus.groovy', name: 'groovy-all', version: '2.4.11', ext: 'jar'
compile fileTree(dir: 'libs', include: '*.jar')
runtimeOnly "org.codehaus.groovy:groovy-all:2.4.11@jar"
runtimeOnly group: 'org.codehaus.groovy', name: 'groovy-all', version: '2.4.11', ext: 'jar'

implementation fileTree(dir: 'libs', include: '*.jar')
}
2 changes: 0 additions & 2 deletions gradle/gradletaskdemo/build/tmp/jar/MANIFEST.MF

This file was deleted.

8 changes: 4 additions & 4 deletions gradle/greeter/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
apply plugin : 'java'
apply plugin : 'application'



dependencies {
compile project(':greeting-library')
compile project(':greeting-library-java')
implementation project(':greeting-library')
implementation project(':greeting-library-java')

implementation group: 'org.codehaus.groovy', name: 'groovy-all', version: '2.4.11', ext: 'jar'
}

mainClassName = 'greeter.Greeter'
Expand Down
6 changes: 2 additions & 4 deletions gradle/greeting-library-java/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
apply plugin :'java'
//apply plugin : 'application'



dependencies{
compile group: 'joda-time', name: 'joda-time', version: '2.9.9'
testCompile group: 'junit', name: 'junit', version: '4.12'
implementation group: 'joda-time', name: 'joda-time', version: '2.9.9'
testImplementation group: 'junit', name: 'junit', version: '4.12'
}
4 changes: 2 additions & 2 deletions gradle/greeting-library/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
apply plugin : 'groovy'

dependencies {
compile 'org.codehaus.groovy:groovy:2.4.12'
implementation 'org.codehaus.groovy:groovy:2.4.12'

testCompile 'org.spockframework:spock-core:1.0-groovy-2.4', {
testImplementation 'org.spockframework:spock-core:1.0-groovy-2.4', {
exclude module : 'groovy-all'
}
}
2 changes: 0 additions & 2 deletions gradle/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,5 @@ include 'greeting-library'
include 'greeting-library-java'
include 'greeter'
include 'gradletaskdemo'
include 'gradle-employee-app'
include 'gradle-source-vs-target-compatibility'

println 'This will be executed during the initialization phase.'