From 98bbe8a394916aa5238c1c87c1617ad3ad17a763 Mon Sep 17 00:00:00 2001 From: Adam Metcalf Date: Fri, 14 Jun 2013 14:47:30 -0700 Subject: Gradle project file. Adds a gradle project file so that other projects can use the :micro and :nano libraries. Change-Id: I7e5aeb584acd11d39e57bf9d4ecfc3af175ffbb2 --- build.gradle | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 build.gradle diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..806ceb6 --- /dev/null +++ b/build.gradle @@ -0,0 +1,51 @@ +apply plugin: 'java' + +jar { + baseName "libprotobuf" + appendix "java" + version "2.3" + classifier "micronano" +} + +project(":external:protobuf:nano") { + apply plugin: 'java' + sourceSets { + main { + java { + // path is relative to external/protobuf/nano which doesn't exist. + srcDirs = ['../java/src/main/java/com/google/protobuf/nano'] + } + } + } + + jar { + baseName "libprotobuf" + appendix "java" + version "2.3" + classifier "nano" + } +} + +project(":external:protobuf:micro") { + apply plugin: 'java' + sourceSets { + main { + java { + srcDirs = ['../java/src/main/java/com/google/protobuf/micro'] + } + } + } + + jar { + baseName "libprotobuf" + appendix "java" + version "2.3" + classifier "micro" + } +} + + +dependencies { + compile project(':external:protobuf:micro') + compile project(':external:protobuf:nano') +} \ No newline at end of file -- cgit v1.1 From 9db9e1e9146b6b59a9c6cfca15c9c80b537ac81e Mon Sep 17 00:00:00 2001 From: Adam Metcalf Date: Mon, 15 Jul 2013 16:58:23 -0700 Subject: Added micro/nano configurations to protobuf in gradle. Change-Id: I7655fafcb4ca3bd6e090d7fd549eda2eb989bfcf --- build.gradle | 72 ++++++++++++++++++++++++++++++------------------------------ 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/build.gradle b/build.gradle index 806ceb6..9caeabd 100644 --- a/build.gradle +++ b/build.gradle @@ -1,51 +1,51 @@ apply plugin: 'java' -jar { - baseName "libprotobuf" - appendix "java" - version "2.3" - classifier "micronano" +configurations { + micro + nano } -project(":external:protobuf:nano") { - apply plugin: 'java' - sourceSets { - main { - java { - // path is relative to external/protobuf/nano which doesn't exist. - srcDirs = ['../java/src/main/java/com/google/protobuf/nano'] - } +sourceSets { + micro { + java { + srcDirs = ['java/src/main/java/com/google/protobuf/micro'] } } - jar { - baseName "libprotobuf" - appendix "java" - version "2.3" - classifier "nano" + nano { + java { + srcDirs = ['java/src/main/java/com/google/protobuf/nano'] + } } } -project(":external:protobuf:micro") { - apply plugin: 'java' - sourceSets { - main { - java { - srcDirs = ['../java/src/main/java/com/google/protobuf/micro'] - } - } - } +jar { + from sourceSets.nano.output, sourceSets.micro.output + baseName "libprotobuf" + appendix "java" + version "2.3" + classifier "micronano" +} - jar { - baseName "libprotobuf" - appendix "java" - version "2.3" - classifier "micro" - } +task nanoJar(type: Jar) { + from sourceSets.nano.output + dependsOn nanoClasses + baseName "libprotobuf" + appendix "java" + version "2.3" + classifier "nano" } +task microJar(type: Jar) { + from sourceSets.micro.output + dependsOn microClasses + baseName "libprotobuf" + appendix "java" + version "2.3" + classifier "micro" +} -dependencies { - compile project(':external:protobuf:micro') - compile project(':external:protobuf:nano') +artifacts { + micro microJar + nano nanoJar } \ No newline at end of file -- cgit v1.1