Skip to content

Commit c4150c8

Browse files
author
nkushnir
committed
add init gradle configs
1 parent f21d2b9 commit c4150c8

File tree

12 files changed

+393
-0
lines changed

12 files changed

+393
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,6 @@ nbbuild/
2121
dist/
2222
nbdist/
2323
.nb-gradle/
24+
25+
### Gradle ###
26+
.gradle

build.gradle

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
buildscript {
2+
repositories {
3+
mavenLocal()
4+
mavenCentral()
5+
}
6+
ext {
7+
springBootVersion = '1.5.6.RELEASE'
8+
}
9+
dependencies {
10+
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
11+
}
12+
}
13+
14+
allprojects {
15+
group = 'com.lohika.jclub'
16+
version = '0.0.1-SNAPSHOT'
17+
buildDir = "build"
18+
19+
apply plugin: 'java'
20+
21+
task printMsg(type: com.lohika.jclub.SimpleTask){
22+
msg = "Project ::::::: ${project.name}"
23+
}
24+
build.dependsOn.add(printMsg)
25+
}
26+
27+
subprojects {
28+
apply plugin: 'org.springframework.boot'
29+
30+
sourceCompatibility = 1.8
31+
targetCompatibility = 1.8
32+
33+
repositories {
34+
mavenLocal()
35+
mavenCentral()
36+
}
37+
38+
buildscript {
39+
ext {
40+
springCloudVersion = 'Dalston.RELEASE'
41+
}
42+
43+
dependencyManagement {
44+
imports {
45+
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
46+
}
47+
}
48+
}
49+
}

buildSrc/build.gradle

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
repositories {
2+
mavenLocal()
3+
mavenCentral()
4+
}
5+
6+
apply plugin: 'groovy'
7+
apply plugin: 'java'
8+
9+
dependencies {
10+
compile gradleApi()
11+
compile localGroovy()
12+
testCompile 'junit:junit:4.12'
13+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.lohika.jclub;
2+
3+
import org.gradle.api.DefaultTask;
4+
import org.gradle.api.tasks.TaskAction;
5+
import org.gradle.api.tasks.Input;
6+
7+
public class SimpleTask extends DefaultTask {
8+
9+
private String msg;
10+
11+
@TaskAction
12+
public void msg() {
13+
System.out.println("Print: " + msg);
14+
}
15+
16+
@Input
17+
public String getMsg() {
18+
return msg;
19+
}
20+
21+
public void setMsg(String msg) {
22+
this.msg = msg;
23+
}
24+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package com.lohika.jclub;
2+
3+
import org.junit.Test;
4+
import org.gradle.api.*;
5+
import org.gradle.testfixtures.*;
6+
7+
import static org.junit.Assert.assertTrue;
8+
9+
public class SimpleTaskTest {
10+
11+
@Test
12+
public void testPrintMsgTask() {
13+
Project project = ProjectBuilder.builder().build()
14+
def task = project.task('printMsg', type: SimpleTask)
15+
task.msg()
16+
assertTrue(task instanceof SimpleTask)
17+
}
18+
19+
}

config-server/build.gradle

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
description = "Configuration server"
2+
3+
jar {
4+
baseName = 'config-server'
5+
}
6+
7+
dependencies {
8+
compile 'org.springframework.boot:spring-boot-starter-actuator'
9+
compile 'org.springframework.cloud:spring-cloud-config-server'
10+
compile 'org.springframework.cloud:spring-cloud-starter-eureka'
11+
testCompile 'org.springframework.boot:spring-boot-starter-test'
12+
}

discovery-server/build.gradle

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
description = "Discovery server"
2+
3+
jar {
4+
baseName = 'discovery-server'
5+
}
6+
7+
dependencies {
8+
compile 'org.springframework.boot:spring-boot-starter-actuator'
9+
compile 'org.springframework.cloud:spring-cloud-starter-eureka-server'
10+
testCompile 'org.springframework.boot:spring-boot-starter-test'
11+
}

gradle/wrapper/gradle-wrapper.jar

52.4 KB
Binary file not shown.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#Wed Sep 06 13:28:01 EEST 2017
2+
distributionBase=GRADLE_USER_HOME
3+
distributionPath=wrapper/dists
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-2.12-bin.zip

gradlew

Lines changed: 160 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)