Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ nbbuild/
dist/
nbdist/
.nb-gradle/

### Gradle ###
.gradle
49 changes: 49 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
buildscript {
repositories {
mavenLocal()
mavenCentral()
}
ext {
springBootVersion = '1.5.6.RELEASE'
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}

allprojects {
group = 'com.lohika.jclub'
version = '0.0.1-SNAPSHOT'
buildDir = "build"

apply plugin: 'java'

task printMsg(type: com.lohika.jclub.SimpleTask){
msg = "Project ::::::: ${project.name}"
}
build.dependsOn.add(printMsg)
}

subprojects {
apply plugin: 'org.springframework.boot'

sourceCompatibility = 1.8
targetCompatibility = 1.8

repositories {
mavenLocal()
mavenCentral()
}

buildscript {
ext {
springCloudVersion = 'Dalston.RELEASE'
}

dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
}
}
}
}
13 changes: 13 additions & 0 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
repositories {
mavenLocal()
mavenCentral()
}

apply plugin: 'groovy'
apply plugin: 'java'

dependencies {
compile gradleApi()
compile localGroovy()
testCompile 'junit:junit:4.12'
}
24 changes: 24 additions & 0 deletions buildSrc/src/main/java/com/lohika/jclub/SimpleTask.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.lohika.jclub;

import org.gradle.api.DefaultTask;
import org.gradle.api.tasks.TaskAction;
import org.gradle.api.tasks.Input;

public class SimpleTask extends DefaultTask {

private String msg;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use 4 spaces


@TaskAction
public void msg() {
System.out.println("Print: " + msg);
}

@Input
public String getMsg() {
return msg;
}

public void setMsg(String msg) {
this.msg = msg;
}
}
19 changes: 19 additions & 0 deletions buildSrc/src/test/groovy/com/lohika/jclub/SimpleTaskTest.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.lohika.jclub;

import org.junit.Test;
import org.gradle.api.*;
import org.gradle.testfixtures.*;

import static org.junit.Assert.assertTrue;

public class SimpleTaskTest {

@Test
public void testPrintMsgTask() {
Project project = ProjectBuilder.builder().build()
def task = project.task('printMsg', type: SimpleTask)
task.msg()
assertTrue(task instanceof SimpleTask)
}

}
12 changes: 12 additions & 0 deletions config-server/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
description = "Configuration server"

jar {
baseName = 'config-server'
}

dependencies {
compile 'org.springframework.boot:spring-boot-starter-actuator'
compile 'org.springframework.cloud:spring-cloud-config-server'
compile 'org.springframework.cloud:spring-cloud-starter-eureka'
testCompile 'org.springframework.boot:spring-boot-starter-test'
}
11 changes: 11 additions & 0 deletions discovery-server/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
description = "Discovery server"

jar {
baseName = 'discovery-server'
}

dependencies {
compile 'org.springframework.boot:spring-boot-starter-actuator'
compile 'org.springframework.cloud:spring-cloud-starter-eureka-server'
testCompile 'org.springframework.boot:spring-boot-starter-test'
}
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 6 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#Wed Sep 06 13:28:01 EEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.12-bin.zip
160 changes: 160 additions & 0 deletions gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading