From 3f1de43146c13111cd8f8f162b58f7e1fb7c097d Mon Sep 17 00:00:00 2001 From: Bluesky Yao Date: Sat, 4 Apr 2015 22:26:20 +0800 Subject: [PATCH] from maven to gradle --- .gitignore | 9 +- build.gradle | 69 ++++ device-api/pom.xml | 50 --- .../src/main/java/SampleController.java | 23 ++ gradle.properties | 1 + pom.xml | 358 ------------------ settings.gradle | 5 + 7 files changed, 105 insertions(+), 410 deletions(-) create mode 100644 build.gradle delete mode 100644 device-api/pom.xml create mode 100644 device-node/src/main/java/SampleController.java create mode 100644 gradle.properties delete mode 100644 pom.xml create mode 100644 settings.gradle diff --git a/.gitignore b/.gitignore index fe88e70..7ceb55a 100644 --- a/.gitignore +++ b/.gitignore @@ -12,12 +12,17 @@ hs_err_pid* *.log target bin +build +test-output .settings -test-output + *.DS_Store .idea +*.iml bower_components/ -node_modules/ \ No newline at end of file +node_modules/ + +.gradle \ No newline at end of file diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..70155f6 --- /dev/null +++ b/build.gradle @@ -0,0 +1,69 @@ + + +buildscript { + repositories { + maven { + url 'http://maven.oschina.net/content/groups/public/' + } + } + dependencies { + classpath("org.springframework.boot:spring-boot-gradle-plugin:1.2.3.RELEASE") + } +} + +subprojects { + version '0.9.0-SNAPSHOT' + + apply plugin: 'java' + + sourceCompatibility = 1.8 + targetCompatibility = 1.8 + + repositories { + maven { + url 'http://maven.oschina.net/content/groups/public/' + } + } + dependencies { + + compile 'org.slf4j:slf4j-api:1.7.12' + compile 'org.slf4j:slf4j-ext:1.7.12' + compile 'ch.qos.logback:logback-classic:1.1.3' + compile 'commons-io:commons-io:2.4' + compile 'org.apache.commons:commons-lang3:3.3.2' + testCompile("junit:junit:4.12") + } + + task echo << { + println ddmlib + } +} + +project(':device-api') { + + ext { + ddmlib = '24.1.3' + } + dependencies { + compile 'org.apache.commons:commons-exec:1.2' + compile 'commons-cli:commons-cli:1.2' + compile "com.android.tools.ddms:ddmlib:$ddmlib" + compile "com.android.tools:dvlib:$ddmlib" + compile "com.android.tools:sdklib:$ddmlib" + compile "com.android.tools:sdk-common:$ddmlib" + + } +} + +project(':device-node') { + + + + apply plugin: 'spring-boot' + + dependencies { + compile("org.springframework.boot:spring-boot-starter-web") + testCompile("org.springframework.boot:spring-boot-starter-test") + } +} + diff --git a/device-api/pom.xml b/device-api/pom.xml deleted file mode 100644 index 144889d..0000000 --- a/device-api/pom.xml +++ /dev/null @@ -1,50 +0,0 @@ - - 4.0.0 - - org.cosysoft.device - device - 0.9.0-SNAPSHOT - - - device-api - - - - - org.apache.commons - commons-exec - - - - - com.android.tools.ddms - ddmlib - - - com.android.tools - dvlib - - - com.android.tools - sdklib - - - com.android.tools - sdk-common - - - - commons-cli - commons-cli - - - commons-io - commons-io - - - org.apache.commons - commons-lang3 - - - \ No newline at end of file diff --git a/device-node/src/main/java/SampleController.java b/device-node/src/main/java/SampleController.java new file mode 100644 index 0000000..917d11a --- /dev/null +++ b/device-node/src/main/java/SampleController.java @@ -0,0 +1,23 @@ +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +/** + * Created by 兰天 on 2015/4/2. + */ +@Controller +@EnableAutoConfiguration +public class SampleController { + + @RequestMapping("/") + @ResponseBody + String home() { + return "Hello World!"; + } + + public static void main(String[] args) throws Exception { + SpringApplication.run(SampleController.class, args); + } +} diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..b8e9359 --- /dev/null +++ b/gradle.properties @@ -0,0 +1 @@ +systemProp.file.encoding=utf-8 \ No newline at end of file diff --git a/pom.xml b/pom.xml deleted file mode 100644 index aec1595..0000000 --- a/pom.xml +++ /dev/null @@ -1,358 +0,0 @@ - - 4.0.0 - org.cosysoft.device - device - 0.9.0-SNAPSHOT - pom - - - UTF-8 - UTF-8 - 1.7 - 1.7 - - - 24.1.2 - 4.1.1.RELEASE - 1.6.10 - 1.7.7 - 2.13 - - - - - - - junit - junit - 4.11 - test - - - - - org.springframework - spring-context - ${org.springframework-version} - - - - commons-logging - commons-logging - - - - - org.springframework - spring-webmvc - ${org.springframework-version} - - - org.springframework - spring-context-support - ${org.springframework-version} - - - org.springframework - spring-test - ${org.springframework-version} - test - - - - - javax.servlet - servlet-api - 2.5 - provided - - - javax.servlet.jsp - jsp-api - 2.1 - provided - - - javax.servlet - jstl - 1.2 - provided - - - - org.apache.httpcomponents - httpclient - 4.3.6 - - - org.apache.httpcomponents - httpmime - 4.3.6 - - - - - com.fasterxml.jackson.core - jackson-databind - 2.3.2 - - - com.thoughtworks.xstream - xstream - 1.4.7 - - - - - - com.google.inject - guice - 3.0 - - - javax.inject - javax.inject - 1 - - - - - org.aspectj - aspectjrt - ${org.aspectj-version} - - - - org.slf4j - slf4j-api - ${org.slf4j-version} - - - org.slf4j - slf4j-ext - ${org.slf4j-version} - - - - - org.slf4j - jcl-over-slf4j - ${org.slf4j-version} - runtime - - - ch.qos.logback - logback-classic - 1.1.2 - - - - com.android.tools.ddms - ddmlib - ${android.tools.version} - - - com.android.tools - dvlib - ${android.tools.version} - - - com.android.tools - sdklib - ${android.tools.version} - - - com.android.tools - sdk-common - ${android.tools.version} - - - - - - commons-cli - commons-cli - 1.2 - - - org.apache.commons - commons-exec - 1.2 - - - org.zeroturnaround - zt-exec - 1.7 - - - commons-io - commons-io - 2.4 - - - org.apache.commons - commons-lang3 - 3.3.2 - - - commons-codec - commons-codec - 1.6 - - - org.jvnet.winp - winp - 1.22 - - - commons-beanutils - commons-beanutils - 1.9.2 - - - commons-configuration - commons-configuration - 1.10 - - - - - - - - - org.slf4j - slf4j-api - - - org.slf4j - slf4j-ext - - - - ch.qos.logback - logback-classic - - - - junit - junit - test - - - - - - - - org.apache.tomcat.maven - tomcat7-maven-plugin - 2.2 - - - org.apache.maven.plugins - maven-surefire-plugin - 2.18.1 - - - -Dfile.encoding=UTF-8 - - - - org.apache.maven.plugins - maven-source-plugin - 2.4 - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.10.1 - - - org.apache.maven.plugins - maven-assembly-plugin - 2.4 - - - org.apache.maven.plugins - maven-shade-plugin - 2.3 - - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - - org.codehaus.mojo - sonar-maven-plugin - - - org.apache.maven.plugins - maven-source-plugin - - - - - - - - - - - - - - release - - true - - - - - org.apache.maven.plugins - maven-source-plugin - - - attach-sources - - jar-no-fork - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - - UTF-8 - UTF-8 - UTF-8 - - - - - attach-javadocs - - jar - - - - - - - - - - - - - device-api - - - diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..dea556e --- /dev/null +++ b/settings.gradle @@ -0,0 +1,5 @@ +rootProject.name = 'device' + +include 'device-api' +include 'device-node' +