From 06526a16db01c6de1caed1f7dab3f839d6eff768 Mon Sep 17 00:00:00 2001 From: Tal Moran Date: Tue, 24 Jan 2017 17:17:09 +0200 Subject: [PATCH] Clean up build files and remove dependency on local nexus repository --- build.gradle | 9 ++-- bulletin-board-client/build.gradle | 55 ++++++------------------- bulletin-board-client/gradlew | 1 + bulletin-board-server/build.gradle | 23 ++--------- distributed-key-generation/build.gradle | 37 +++-------------- meerkat-common/build.gradle | 32 ++++---------- mixer/build.gradle | 40 +++--------------- polling-station/build.gradle | 38 ++--------------- restful-api-common/build.gradle | 35 ++-------------- voting-booth/build.gradle | 38 ++--------------- 10 files changed, 53 insertions(+), 255 deletions(-) create mode 120000 bulletin-board-client/gradlew diff --git a/build.gradle b/build.gradle index 8c01ae9..ed7d229 100644 --- a/build.gradle +++ b/build.gradle @@ -5,9 +5,12 @@ plugins { subprojects { proj -> proj.afterEvaluate { // Used to generate initial maven-dir layout - task "create-dirs" { description = "Create default maven directory structure" } << { - sourceSets*.java.srcDirs*.each { it.mkdirs() } - sourceSets*.resources.srcDirs*.each { it.mkdirs() } + task "create-dirs" { + description = "Create default maven directory structure" + doLast { + sourceSets*.java.srcDirs*.each { it.mkdirs() } + sourceSets*.resources.srcDirs*.each { it.mkdirs() } + } } } } diff --git a/bulletin-board-client/build.gradle b/bulletin-board-client/build.gradle index 8f00228..f870887 100644 --- a/bulletin-board-client/build.gradle +++ b/bulletin-board-client/build.gradle @@ -16,12 +16,6 @@ ext { isSnapshot = false } ext { groupId = 'org.factcenter.meerkat' - nexusRepository = "https://cs.idc.ac.il/nexus/content/groups/${isSnapshot ? 'unstable' : 'public'}/" - - // Credentials for IDC nexus repositories (needed only for using unstable repositories and publishing) - // Should be set in ${HOME}/.gradle/gradle.properties - nexusUser = project.hasProperty('nexusUser') ? project.property('nexusUser') : "" - nexusPassword = project.hasProperty('nexusPassword') ? project.property('nexusPassword') : "" } description = "Meerkat Voting Common Library" @@ -38,23 +32,10 @@ dependencies { compile project(':meerkat-common') compile project(':restful-api-common') - // Jersey for RESTful API - compile 'org.glassfish.jersey.containers:jersey-container-servlet:2.22.+' + + // Databases compile 'org.xerial:sqlite-jdbc:3.7.+' - // Logging - compile 'org.slf4j:slf4j-api:1.7.7' - runtime 'ch.qos.logback:logback-classic:1.1.2' - runtime 'ch.qos.logback:logback-core:1.1.2' - - // Google protobufs - compile 'com.google.protobuf:protobuf-java:3.+' - - // Crypto - compile 'org.factcenter.qilin:qilin:1.1+' - compile 'org.bouncycastle:bcprov-jdk15on:1.53' - compile 'org.bouncycastle:bcpkix-jdk15on:1.53' - // Depend on test resources from meerkat-common testCompile project(path: ':meerkat-common', configuration: 'testOutput') @@ -178,34 +159,22 @@ if (project.hasProperty('mainClassName') && (mainClassName != null)) { *===================================*/ repositories { - + // Use local repo if possible mavenLocal(); - // Prefer the local nexus repository (it may have 3rd party artifacts not found in mavenCentral) - maven { - url nexusRepository - - if (isSnapshot) { - credentials { username - password - - username nexusUser - password nexusPassword - } - } - } - // Use 'maven central' for other dependencies. mavenCentral() } -task "info" << { - println "Project: ${project.name}" - println "Description: ${project.description}" - println "--------------------------" - println "GroupId: $groupId" - println "Version: $version (${isSnapshot ? 'snapshot' : 'release'})" - println "" +task "info" { + doLast { + println "Project: ${project.name}" + println "Description: ${project.description}" + println "--------------------------" + println "GroupId: $groupId" + println "Version: $version (${isSnapshot ? 'snapshot' : 'release'})" + println "" + } } info.description 'Print some information about project parameters' diff --git a/bulletin-board-client/gradlew b/bulletin-board-client/gradlew new file mode 120000 index 0000000..502f5a2 --- /dev/null +++ b/bulletin-board-client/gradlew @@ -0,0 +1 @@ +../gradlew \ No newline at end of file diff --git a/bulletin-board-server/build.gradle b/bulletin-board-server/build.gradle index bb28fb8..2ab85b0 100644 --- a/bulletin-board-server/build.gradle +++ b/bulletin-board-server/build.gradle @@ -22,12 +22,6 @@ ext { isSnapshot = false } ext { groupId = 'org.factcenter.meerkat' - nexusRepository = "https://cs.idc.ac.il/nexus/content/groups/${isSnapshot ? 'unstable' : 'public'}/" - - // Credentials for IDC nexus repositories (needed only for using unstable repositories and publishing) - // Should be set in ${HOME}/.gradle/gradle.properties - nexusUser = project.hasProperty('nexusUser') ? project.property('nexusUser') : "" - nexusPassword = project.hasProperty('nexusPassword') ? project.property('nexusPassword') : "" } description = "Bulletin-board server web application" @@ -43,9 +37,6 @@ dependencies { compile project(':meerkat-common') compile project(':restful-api-common') - // Jersey for RESTful API - compile 'org.glassfish.jersey.containers:jersey-container-servlet:2.22.+' - // JDBC connections compile 'org.springframework:spring-jdbc:4.2.+' compile 'org.xerial:sqlite-jdbc:3.8.+' @@ -56,14 +47,6 @@ dependencies { // Servlets compile 'javax.servlet:javax.servlet-api:3.0.+' - // Logging - compile 'org.slf4j:slf4j-api:1.7.7' - runtime 'ch.qos.logback:logback-classic:1.1.2' - runtime 'ch.qos.logback:logback-core:1.1.2' - - // Google protobufs - compile 'com.google.protobuf:protobuf-java:3.+' - // Depend on test resources from meerkat-common testCompile project(path: ':meerkat-common', configuration: 'testOutput') @@ -220,13 +203,15 @@ repositories { mavenCentral() } -task "info" << { +task "info" { + doLast { println "Project: ${project.name}" -println "Description: ${project.description}" + println "Description: ${project.description}" println "--------------------------" println "GroupId: $groupId" println "Version: $version (${isSnapshot ? 'snapshot' : 'release'})" println "" + } } info.description 'Print some information about project parameters' diff --git a/distributed-key-generation/build.gradle b/distributed-key-generation/build.gradle index 6befbc4..b47e8f2 100644 --- a/distributed-key-generation/build.gradle +++ b/distributed-key-generation/build.gradle @@ -21,12 +21,6 @@ ext { isSnapshot = false } ext { groupId = 'org.factcenter.meerkat' - nexusRepository = "https://cs.idc.ac.il/nexus/content/groups/${isSnapshot ? 'unstable' : 'public'}/" - - // Credentials for IDC nexus repositories (needed only for using unstable repositories and publishing) - // Should be set in ${HOME}/.gradle/gradle.properties - nexusUser = project.hasProperty('nexusUser') ? project.property('nexusUser') : "" - nexusPassword = project.hasProperty('nexusPassword') ? project.property('nexusPassword') : "" } description = "TODO: Add a description" @@ -41,14 +35,6 @@ dependencies { // Meerkat common compile project(':meerkat-common') - // Logging - compile 'org.slf4j:slf4j-api:1.7.7' - runtime 'ch.qos.logback:logback-classic:1.1.2' - runtime 'ch.qos.logback:logback-core:1.1.2' - - // Google protobufs - compile 'com.google.protobuf:protobuf-java:3.+' - // Depend on test resources from meerkat-common testCompile project(path: ':meerkat-common', configuration: 'testOutput') @@ -99,7 +85,7 @@ idea { def srcDir = "${protobuf.generatedFilesBaseDir}/$sourceSet.name/java" - println "Adding $srcDir" +// println "Adding $srcDir" // add protobuf generated sources to generated source dir. if ("test".equals(sourceSet.name)) { testSourceDirs += file(srcDir) @@ -158,21 +144,6 @@ if (project.hasProperty('mainClassName') && (mainClassName != null)) { *===================================*/ repositories { - - // Prefer the local nexus repository (it may have 3rd party artifacts not found in mavenCentral) - maven { - url nexusRepository - - if (isSnapshot) { - credentials { username - password - - username nexusUser - password nexusPassword - } - } - } - // Use local maven repository mavenLocal() @@ -180,13 +151,15 @@ repositories { mavenCentral() } -task "info" << { +task "info" { + doLast { println "Project: ${project.name}" -println "Description: ${project.description}" + println "Description: ${project.description}" println "--------------------------" println "GroupId: $groupId" println "Version: $version (${isSnapshot ? 'snapshot' : 'release'})" println "" + } } info.description 'Print some information about project parameters' diff --git a/meerkat-common/build.gradle b/meerkat-common/build.gradle index 896a547..bc380ed 100644 --- a/meerkat-common/build.gradle +++ b/meerkat-common/build.gradle @@ -20,12 +20,6 @@ ext { isSnapshot = false } ext { groupId = 'org.factcenter.meerkat' - nexusRepository = "https://cs.idc.ac.il/nexus/content/groups/${isSnapshot ? 'unstable' : 'public'}/" - - // Credentials for IDC nexus repositories (needed only for using unstable repositories and publishing) - // Should be set in ${HOME}/.gradle/gradle.properties - nexusUser = project.hasProperty('nexusUser') ? project.property('nexusUser') : "" - nexusPassword = project.hasProperty('nexusPassword') ? project.property('nexusPassword') : "" } description = "Meerkat Voting Common Library" @@ -39,10 +33,12 @@ version += "${isSnapshot ? '-SNAPSHOT' : ''}" dependencies { // Logging compile 'org.slf4j:slf4j-api:1.7.7' - compile 'javax.ws.rs:javax.ws.rs-api:2.0.+' runtime 'ch.qos.logback:logback-classic:1.1.2' runtime 'ch.qos.logback:logback-core:1.1.2' + // RESTful API + compile 'javax.ws.rs:javax.ws.rs-api:2.0.+' + // Google protobufs compile 'com.google.protobuf:protobuf-java:3.+' @@ -50,7 +46,7 @@ dependencies { compile 'com.google.guava:guava:15.0' // Crypto - compile 'org.factcenter.qilin:qilin:1.2.+' + compile 'org.factcenter.qilin:qilin:1.3.+' compile 'org.bouncycastle:bcprov-jdk15on:1.53' testCompile 'junit:junit:4.+' @@ -157,32 +153,20 @@ task fatCapsule(type: FatCapsule){ repositories { mavenLocal(); - - // Prefer the local nexus repository (it may have 3rd party artifacts not found in mavenCentral) - maven { - url nexusRepository - - if (isSnapshot) { - credentials { username - password - - username nexusUser - password nexusPassword - } - } - } // Use 'maven central' for other dependencies. mavenCentral() } -task "info" << { +task "info" { + doLast { println "Project: ${project.name}" -println "Description: ${project.description}" + println "Description: ${project.description}" println "--------------------------" println "GroupId: $groupId" println "Version: $version (${isSnapshot ? 'snapshot' : 'release'})" println "" + } } info.description 'Print some information about project parameters' diff --git a/mixer/build.gradle b/mixer/build.gradle index 3973fa0..bdde270 100644 --- a/mixer/build.gradle +++ b/mixer/build.gradle @@ -21,12 +21,6 @@ ext { isSnapshot = false } ext { groupId = 'org.factcenter.meerkat' - nexusRepository = "https://cs.idc.ac.il/nexus/content/groups/${isSnapshot ? 'unstable' : 'public'}/" - - // Credentials for IDC nexus repositories (needed only for using unstable repositories and publishing) - // Should be set in ${HOME}/.gradle/gradle.properties - nexusUser = project.hasProperty('nexusUser') ? project.property('nexusUser') : "" - nexusPassword = project.hasProperty('nexusPassword') ? project.property('nexusPassword') : "" } description = "Mix network implementation" @@ -41,17 +35,6 @@ dependencies { // Meerkat common compile project(':meerkat-common') - // Logging - compile 'org.slf4j:slf4j-api:1.7.7' - runtime 'ch.qos.logback:logback-classic:1.1.2' - runtime 'ch.qos.logback:logback-core:1.1.2' - - // Google protobufs - compile 'com.google.protobuf:protobuf-java:3.+' - - // Crypto - compile 'org.factcenter.qilin:qilin:1.2.+' - // Command-line parsing. compile 'net.sf.jopt-simple:jopt-simple:6.+' @@ -87,7 +70,7 @@ idea { def srcDir = "${protobuf.generatedFilesBaseDir}/$sourceSet.name/java" - println "Adding $srcDir" +// println "Adding $srcDir" // add protobuf generated sources to generated source dir. if ("test".equals(sourceSet.name)) { testSourceDirs += file(srcDir) @@ -146,21 +129,6 @@ if (project.hasProperty('mainClassName') && (mainClassName != null)) { *===================================*/ repositories { - - // Prefer the local nexus repository (it may have 3rd party artifacts not found in mavenCentral) - maven { - url nexusRepository - - if (isSnapshot) { - credentials { username - password - - username nexusUser - password nexusPassword - } - } - } - // Use local maven repository mavenLocal() @@ -168,13 +136,15 @@ repositories { mavenCentral() } -task "info" << { +task "info" { + doLast { println "Project: ${project.name}" -println "Description: ${project.description}" + println "Description: ${project.description}" println "--------------------------" println "GroupId: $groupId" println "Version: $version (${isSnapshot ? 'snapshot' : 'release'})" println "" + } } info.description 'Print some information about project parameters' diff --git a/polling-station/build.gradle b/polling-station/build.gradle index 2f73721..c45498f 100644 --- a/polling-station/build.gradle +++ b/polling-station/build.gradle @@ -22,12 +22,6 @@ ext { isSnapshot = false } ext { groupId = 'org.factcenter.meerkat' - nexusRepository = "https://cs.idc.ac.il/nexus/content/groups/${isSnapshot ? 'unstable' : 'public'}/" - - // Credentials for IDC nexus repositories (needed only for using unstable repositories and publishing) - // Should be set in ${HOME}/.gradle/gradle.properties - nexusUser = project.hasProperty('nexusUser') ? project.property('nexusUser') : "" - nexusPassword = project.hasProperty('nexusPassword') ? project.property('nexusPassword') : "" } description = "Meerkat polling-station application" @@ -43,21 +37,10 @@ dependencies { compile project(':meerkat-common') compile project(':restful-api-common') - // Jersey for RESTful API - compile 'org.glassfish.jersey.containers:jersey-container-servlet:2.5.+' - // Servlets compile 'org.eclipse.jetty:jetty-server:9.3.+' compile 'org.eclipse.jetty:jetty-servlet:9.3.+' - // Logging - compile 'org.slf4j:slf4j-api:1.7.7' - runtime 'ch.qos.logback:logback-classic:1.1.2' - runtime 'ch.qos.logback:logback-core:1.1.2' - - // Google protobufs - compile 'com.google.protobuf:protobuf-java:3.+' - testCompile 'junit:junit:4.+' runtime 'org.codehaus.groovy:groovy:2.4.+' @@ -137,21 +120,6 @@ if (project.hasProperty('mainClassName') && (mainClassName != null)) { *===================================*/ repositories { - - // Prefer the local nexus repository (it may have 3rd party artifacts not found in mavenCentral) - maven { - url nexusRepository - - if (isSnapshot) { - credentials { username - password - - username nexusUser - password nexusPassword - } - } - } - // Use local maven repository mavenLocal() @@ -159,13 +127,15 @@ repositories { mavenCentral() } -task "info" << { +task "info" { + doLast { println "Project: ${project.name}" -println "Description: ${project.description}" + println "Description: ${project.description}" println "--------------------------" println "GroupId: $groupId" println "Version: $version (${isSnapshot ? 'snapshot' : 'release'})" println "" + } } info.description 'Print some information about project parameters' diff --git a/restful-api-common/build.gradle b/restful-api-common/build.gradle index a9c80b9..937b79d 100644 --- a/restful-api-common/build.gradle +++ b/restful-api-common/build.gradle @@ -19,12 +19,6 @@ ext { isSnapshot = false } ext { groupId = 'org.factcenter.meerkat' - nexusRepository = "https://cs.idc.ac.il/nexus/content/groups/${isSnapshot ? 'unstable' : 'public'}/" - - // Credentials for IDC nexus repositories (needed only for using unstable repositories and publishing) - // Should be set in ${HOME}/.gradle/gradle.properties - nexusUser = project.hasProperty('nexusUser') ? project.property('nexusUser') : "" - nexusPassword = project.hasProperty('nexusPassword') ? project.property('nexusPassword') : "" } description = "Common classes for implementing Meerkat's RESTful API" @@ -42,14 +36,6 @@ dependencies { // Jersey for RESTful API compile 'org.glassfish.jersey.containers:jersey-container-servlet:2.22.+' - // Logging - compile 'org.slf4j:slf4j-api:1.7.7' - runtime 'ch.qos.logback:logback-classic:1.1.2' - runtime 'ch.qos.logback:logback-core:1.1.2' - - // Google protobufs - compile 'com.google.protobuf:protobuf-java:3.+' - testCompile 'junit:junit:4.+' runtime 'org.codehaus.groovy:groovy:2.4.+' @@ -95,21 +81,6 @@ idea { *===================================*/ repositories { - - // Prefer the local nexus repository (it may have 3rd party artifacts not found in mavenCentral) - maven { - url nexusRepository - - if (isSnapshot) { - credentials { username - password - - username nexusUser - password nexusPassword - } - } - } - // Use local maven repository mavenLocal() @@ -117,13 +88,15 @@ repositories { mavenCentral() } -task "info" << { +task "info" { + doLast { println "Project: ${project.name}" -println "Description: ${project.description}" + println "Description: ${project.description}" println "--------------------------" println "GroupId: $groupId" println "Version: $version (${isSnapshot ? 'snapshot' : 'release'})" println "" + } } info.description 'Print some information about project parameters' diff --git a/voting-booth/build.gradle b/voting-booth/build.gradle index 0920359..682f398 100644 --- a/voting-booth/build.gradle +++ b/voting-booth/build.gradle @@ -20,12 +20,6 @@ ext { isSnapshot = false } ext { groupId = 'org.factcenter.meerkat' - nexusRepository = "https://cs.idc.ac.il/nexus/content/groups/${isSnapshot ? 'unstable' : 'public'}/" - - // Credentials for IDC nexus repositories (needed only for using unstable repositories and publishing) - // Should be set in ${HOME}/.gradle/gradle.properties - nexusUser = project.hasProperty('nexusUser') ? project.property('nexusUser') : "" - nexusPassword = project.hasProperty('nexusPassword') ? project.property('nexusPassword') : "" } description = "Meerkat voting booth application" @@ -41,22 +35,11 @@ dependencies { compile project(':meerkat-common') compile project(':restful-api-common') - // Jersey for RESTful API - compile 'org.glassfish.jersey.containers:jersey-container-servlet:2.5.+' - // Servlets compile group: 'org.eclipse.jetty', name: 'jetty-server', version: '9.3.+' compile 'org.eclipse.jetty:jetty-server:9.3.+' compile 'org.eclipse.jetty:jetty-servlet:9.3.+' - // Logging - compile 'org.slf4j:slf4j-api:1.7.7' - runtime 'ch.qos.logback:logback-classic:1.1.2' - runtime 'ch.qos.logback:logback-core:1.1.2' - - // Google protobufs - compile 'com.google.protobuf:protobuf-java:3.+' - testCompile 'junit:junit:4.+' runtime 'org.codehaus.groovy:groovy:2.4.+' @@ -140,21 +123,6 @@ if (project.hasProperty('mainClassName') && (mainClassName != null)) { *===================================*/ repositories { - - // Prefer the local nexus repository (it may have 3rd party artifacts not found in mavenCentral) - maven { - url nexusRepository - - if (isSnapshot) { - credentials { username - password - - username nexusUser - password nexusPassword - } - } - } - // Use local maven repository mavenLocal() @@ -162,13 +130,15 @@ repositories { mavenCentral() } -task "info" << { +task "info" { + doLast { println "Project: ${project.name}" -println "Description: ${project.description}" + println "Description: ${project.description}" println "--------------------------" println "GroupId: $groupId" println "Version: $version (${isSnapshot ? 'snapshot' : 'release'})" println "" + } } info.description 'Print some information about project parameters'