fixed some merge conflicts which appeared for some unknown reason

vbdev2
Hai Brenner 2016-06-26 17:07:03 +03:00
parent ffac7c1e34
commit 06d69554d9
2 changed files with 453 additions and 456 deletions

View File

@ -1,263 +1,262 @@
plugins { plugins {
id "us.kirchmeier.capsule" version "1.0.1" id "us.kirchmeier.capsule" version "1.0.1"
id 'com.google.protobuf' version '0.7.0' id 'com.google.protobuf' version '0.7.0'
id 'org.akhikhl.gretty' version "1.2.4" id 'org.akhikhl.gretty' version "1.2.4"
} }
apply plugin: 'org.akhikhl.gretty' apply plugin: 'org.akhikhl.gretty'
apply plugin: 'java' apply plugin: 'java'
apply plugin: 'eclipse' apply plugin: 'eclipse'
apply plugin: 'idea' apply plugin: 'idea'
//apply plugin: 'application' //apply plugin: 'application'
//apply plugin: 'jetty' //apply plugin: 'jetty'
//mainClassName = 'SQLiteIntegrationTest' //mainClassName = 'SQLiteIntegrationTest'
apply plugin: 'maven-publish' apply plugin: 'maven-publish'
// Is this a snapshot version? // Is this a snapshot version?
ext { isSnapshot = false } ext { isSnapshot = false }
ext { ext {
groupId = 'org.factcenter.meerkat' groupId = 'org.factcenter.meerkat'
nexusRepository = "https://cs.idc.ac.il/nexus/content/groups/${isSnapshot ? 'unstable' : 'public'}/" 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) // Credentials for IDC nexus repositories (needed only for using unstable repositories and publishing)
// Should be set in ${HOME}/.gradle/gradle.properties // Should be set in ${HOME}/.gradle/gradle.properties
nexusUser = project.hasProperty('nexusUser') ? project.property('nexusUser') : "" nexusUser = project.hasProperty('nexusUser') ? project.property('nexusUser') : ""
nexusPassword = project.hasProperty('nexusPassword') ? project.property('nexusPassword') : "" nexusPassword = project.hasProperty('nexusPassword') ? project.property('nexusPassword') : ""
} }
description = "Bulletin-board server web application" description = "Bulletin-board server web application"
// Your project version // Your project version
version = "0.0.1" version = "0.0.1"
version += "${isSnapshot ? '-SNAPSHOT' : ''}" version += "${isSnapshot ? '-SNAPSHOT' : ''}"
dependencies { dependencies {
// Meerkat common // Meerkat common
compile project(':meerkat-common') compile project(':meerkat-common')
compile project(':restful-api-common') compile project(':restful-api-common')
// Jersey for RESTful API // Jersey for RESTful API
compile 'org.glassfish.jersey.containers:jersey-container-servlet:2.22.+' compile 'org.glassfish.jersey.containers:jersey-container-servlet:2.22.+'
// JDBC connections // JDBC connections
compile 'org.springframework:spring-jdbc:4.2.+' compile 'org.springframework:spring-jdbc:4.2.+'
compile 'org.xerial:sqlite-jdbc:3.8.+' compile 'org.xerial:sqlite-jdbc:3.8.+'
compile 'mysql:mysql-connector-java:5.1.+' compile 'mysql:mysql-connector-java:5.1.+'
compile 'com.h2database:h2:1.0.+' compile 'com.h2database:h2:1.0.+'
compile 'org.apache.commons:commons-dbcp2:2.0.+' compile 'org.apache.commons:commons-dbcp2:2.0.+'
// Servlets // Servlets
compile 'javax.servlet:javax.servlet-api:3.0.+' compile 'javax.servlet:javax.servlet-api:3.0.+'
// Logging // Logging
compile 'org.slf4j:slf4j-api:1.7.7' compile 'org.slf4j:slf4j-api:1.7.7'
runtime 'ch.qos.logback:logback-classic:1.1.2' runtime 'ch.qos.logback:logback-classic:1.1.2'
runtime 'ch.qos.logback:logback-core:1.1.2' runtime 'ch.qos.logback:logback-core:1.1.2'
// Google protobufs // Google protobufs
compile 'com.google.protobuf:protobuf-java:3.+' compile 'com.google.protobuf:protobuf-java:3.+'
// Depend on test resources from meerkat-common // Depend on test resources from meerkat-common
testCompile project(path: ':meerkat-common', configuration: 'testOutput') testCompile project(path: ':meerkat-common', configuration: 'testOutput')
testCompile 'junit:junit:4.+' testCompile 'junit:junit:4.+'
runtime 'org.codehaus.groovy:groovy:2.4.+' runtime 'org.codehaus.groovy:groovy:2.4.+'
} }
test { test {
exclude '**/*SQLite*Test*' exclude '**/*SQLite*Test*'
exclude '**/*H2*Test*' exclude '**/*H2*Test*'
exclude '**/*MySQL*Test*' exclude '**/*MySQL*Test*'
exclude '**/*IntegrationTest*' exclude '**/*IntegrationTest*'
} }
task myTest(type: Test) { task myTest(type: Test) {
include '**/*MySQL*Test*' include '**/*MySQL*Test*'
outputs.upToDateWhen { false } outputs.upToDateWhen { false }
} }
task h2Test(type: Test) { task h2Test(type: Test) {
include '**/*H2*Test*' include '**/*H2*Test*'
outputs.upToDateWhen { false } outputs.upToDateWhen { false }
} }
task liteTest(type: Test) { task liteTest(type: Test) {
include '**/*SQLite*Test*' include '**/*SQLite*Test*'
outputs.upToDateWhen { false } outputs.upToDateWhen { false }
} }
task dbTest(type: Test) { task dbTest(type: Test) {
include '**/*H2*Test*' include '**/*H2*Test*'
include '**/*MySQL*Test*' include '**/*MySQL*Test*'
include '**/*SQLite*Test*' include '**/*SQLite*Test*'
outputs.upToDateWhen { false } outputs.upToDateWhen { false }
} }
task manualIntegration(type: Test) { task manualIntegration(type: Test) {
include '**/*IntegrationTest*' include '**/*IntegrationTest*'
} }
task integrationTest(type: Test) { task integrationTest(type: Test) {
include '**/*IntegrationTest*' include '**/*IntegrationTest*'
// debug = true // debug = true
outputs.upToDateWhen { false } outputs.upToDateWhen { false }
} }
gretty { gretty {
httpPort = 8081 httpPort = 8081
contextPath = '/' contextPath = '/'
integrationTestTask = 'integrationTest' integrationTestTask = 'integrationTest'
loggingLevel = 'TRACE' loggingLevel = 'TRACE'
debugPort = 5006 debugPort = 5006
} }
/*==== You probably don't have to edit below this line =======*/ /*==== You probably don't have to edit below this line =======*/
protobuf { protobuf {
// Configure the protoc executable // Configure the protoc executable
protoc { protoc {
// Download from repositories // Download from repositories
artifact = 'com.google.protobuf:protoc:3.+' artifact = 'com.google.protobuf:protoc:3.+'
} }
} }
idea { idea {
module { module {
project.sourceSets.each { sourceSet -> project.sourceSets.each { sourceSet ->
def srcDir = "${protobuf.generatedFilesBaseDir}/$sourceSet.name/java" def srcDir = "${protobuf.generatedFilesBaseDir}/$sourceSet.name/java"
// add protobuf generated sources to generated source dir. // add protobuf generated sources to generated source dir.
if ("test".equals(sourceSet.name)) { if ("test".equals(sourceSet.name)) {
testSourceDirs += file(srcDir) testSourceDirs += file(srcDir)
} else { } else {
sourceDirs += file(srcDir) sourceDirs += file(srcDir)
} }
generatedSourceDirs += file(srcDir) generatedSourceDirs += file(srcDir)
} }
// Don't exclude build directory // Don't exclude build directory
excludeDirs -= file(buildDir) excludeDirs -= file(buildDir)
} }
} }
/*=================================== /*===================================
* "Fat" Build targets * "Fat" Build targets
*===================================*/ *===================================*/
if (project.hasProperty('mainClassName') && (mainClassName != null)) { if (project.hasProperty('mainClassName') && (mainClassName != null)) {
task mavenCapsule(type: MavenCapsule) { task mavenCapsule(type: MavenCapsule) {
description = "Generate a capsule jar that automatically downloads and caches dependencies when run." description = "Generate a capsule jar that automatically downloads and caches dependencies when run."
applicationClass mainClassName applicationClass mainClassName
destinationDir = buildDir destinationDir = buildDir
} }
task fatCapsule(type: FatCapsule) { task fatCapsule(type: FatCapsule) {
description = "Generate a single capsule jar containing everything. Use -Pfatmain=... to override main class" description = "Generate a single capsule jar containing everything. Use -Pfatmain=... to override main class"
destinationDir = buildDir destinationDir = buildDir
def fatMain = hasProperty('fatmain') ? fatmain : mainClassName def fatMain = hasProperty('fatmain') ? fatmain : mainClassName
applicationClass fatMain applicationClass fatMain
def testJar = hasProperty('test') def testJar = hasProperty('test')
if (hasProperty('fatmain')) { if (hasProperty('fatmain')) {
appendix = "fat-${fatMain}" appendix = "fat-${fatMain}"
} else { } else {
appendix = "fat" appendix = "fat"
} }
if (testJar) { if (testJar) {
from sourceSets.test.output from sourceSets.test.output
} }
} }
} }
/*=================================== /*===================================
* Repositories * Repositories
*===================================*/ *===================================*/
repositories { repositories {
// Prefer the local nexus repository (it may have 3rd party artifacts not found in mavenCentral) // Prefer the local nexus repository (it may have 3rd party artifacts not found in mavenCentral)
maven { maven {
url nexusRepository url nexusRepository
if (isSnapshot) { if (isSnapshot) {
credentials { username credentials { username
password password
username nexusUser username nexusUser
password nexusPassword password nexusPassword
} }
} }
} }
// Use local maven repository // Use local maven repository
mavenLocal() mavenLocal()
jcenter() jcenter()
// Use 'maven central' for other dependencies. // Use 'maven central' for other dependencies.
mavenCentral() mavenCentral()
} }
task "info" << { task "info" << {
println "Project: ${project.name}" println "Project: ${project.name}"
println "Description: ${project.description}" println "Description: ${project.description}"
println "--------------------------" println "--------------------------"
println "GroupId: $groupId" println "GroupId: $groupId"
println "Version: $version (${isSnapshot ? 'snapshot' : 'release'})" println "Version: $version (${isSnapshot ? 'snapshot' : 'release'})"
println "" println ""
} }
info.description 'Print some information about project parameters' info.description 'Print some information about project parameters'
/*=================================== /*===================================
* Publishing * Publishing
*===================================*/ *===================================*/
publishing { publishing {
publications { publications {
mavenJava(MavenPublication) { mavenJava(MavenPublication) {
groupId project.groupId groupId project.groupId
pom.withXml { pom.withXml {
asNode().appendNode('description', project.description) asNode().appendNode('description', project.description)
} }
from project.components.java from project.components.java
} }
} }
repositories { repositories {
maven { maven {
url "https://cs.idc.ac.il/nexus/content/repositories/${project.isSnapshot ? 'snapshots' : 'releases'}" url "https://cs.idc.ac.il/nexus/content/repositories/${project.isSnapshot ? 'snapshots' : 'releases'}"
credentials { username credentials { username
password password
username nexusUser username nexusUser
password nexusPassword password nexusPassword
} }
} }
} }
} }

View File

@ -1,193 +1,191 @@
plugins { plugins {
id "us.kirchmeier.capsule" version "1.0.1" id "us.kirchmeier.capsule" version "1.0.1"
id 'com.google.protobuf' version '0.7.0' id 'com.google.protobuf' version '0.7.0'
} }
apply plugin: 'java' apply plugin: 'java'
apply plugin: 'eclipse' apply plugin: 'eclipse'
apply plugin: 'idea' apply plugin: 'idea'
apply plugin: 'maven-publish' apply plugin: 'maven-publish'
// Uncomment the lines below to define an application // Uncomment the lines below to define an application
// (this will also allow you to build a "fatCapsule" which includes // (this will also allow you to build a "fatCapsule" which includes
// the entire application, including all dependencies in a single jar) // the entire application, including all dependencies in a single jar)
//apply plugin: 'application' //apply plugin: 'application'
//mainClassName='your.main.ApplicationClass' //mainClassName='your.main.ApplicationClass'
// Is this a snapshot version? // Is this a snapshot version?
ext { isSnapshot = false } ext { isSnapshot = false }
ext { ext {
groupId = 'org.factcenter.meerkat' groupId = 'org.factcenter.meerkat'
nexusRepository = "https://cs.idc.ac.il/nexus/content/groups/${isSnapshot ? 'unstable' : 'public'}/" 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) // Credentials for IDC nexus repositories (needed only for using unstable repositories and publishing)
// Should be set in ${HOME}/.gradle/gradle.properties // Should be set in ${HOME}/.gradle/gradle.properties
nexusUser = project.hasProperty('nexusUser') ? project.property('nexusUser') : "" nexusUser = project.hasProperty('nexusUser') ? project.property('nexusUser') : ""
nexusPassword = project.hasProperty('nexusPassword') ? project.property('nexusPassword') : "" nexusPassword = project.hasProperty('nexusPassword') ? project.property('nexusPassword') : ""
} }
description = "Meerkat voting booth application" description = "Meerkat voting booth application"
// Your project version // Your project version
version = "0.0" version = "0.0"
version += "${isSnapshot ? '-SNAPSHOT' : ''}" version += "${isSnapshot ? '-SNAPSHOT' : ''}"
dependencies { dependencies {
// Meerkat common // Meerkat common
compile project(':meerkat-common') compile project(':meerkat-common')
// Logging // Logging
compile 'org.slf4j:slf4j-api:1.7.7' compile 'org.slf4j:slf4j-api:1.7.7'
runtime 'ch.qos.logback:logback-classic:1.1.2' runtime 'ch.qos.logback:logback-classic:1.1.2'
runtime 'ch.qos.logback:logback-core:1.1.2' runtime 'ch.qos.logback:logback-core:1.1.2'
// Google protobufs // Google protobufs
compile 'com.google.protobuf:protobuf-java:3.+' compile 'com.google.protobuf:protobuf-java:3.+'
testCompile 'junit:junit:4.+' testCompile 'junit:junit:4.+'
runtime 'org.codehaus.groovy:groovy:2.4.+' runtime 'org.codehaus.groovy:groovy:2.4.+'
} }
/*==== You probably don't have to edit below this line =======*/ /*==== You probably don't have to edit below this line =======*/
protobuf { protobuf {
// Configure the protoc executable // Configure the protoc executable
protoc { protoc {
// Download from repositories // Download from repositories
artifact = 'com.google.protobuf:protoc:3.+' artifact = 'com.google.protobuf:protoc:3.+'
} }
} }
idea { idea {
module { module {
project.sourceSets.each { sourceSet -> project.sourceSets.each { sourceSet ->
def srcDir = "${protobuf.generatedFilesBaseDir}/$sourceSet.name/java" def srcDir = "${protobuf.generatedFilesBaseDir}/$sourceSet.name/java"
// add protobuf generated sources to generated source dir. // add protobuf generated sources to generated source dir.
if ("test".equals(sourceSet.name)) { if ("test".equals(sourceSet.name)) {
testSourceDirs += file(srcDir) testSourceDirs += file(srcDir)
} else { } else {
sourceDirs += file(srcDir) sourceDirs += file(srcDir)
} }
generatedSourceDirs += file(srcDir) generatedSourceDirs += file(srcDir)
} }
// Don't exclude build directory // Don't exclude build directory
excludeDirs -= file(buildDir) excludeDirs -= file(buildDir)
} }
} }
/*=================================== /*===================================
* "Fat" Build targets * "Fat" Build targets
*===================================*/ *===================================*/
if (project.hasProperty('mainClassName') && (mainClassName != null)) { if (project.hasProperty('mainClassName') && (mainClassName != null)) {
task mavenCapsule(type: MavenCapsule) { task mavenCapsule(type: MavenCapsule) {
description = "Generate a capsule jar that automatically downloads and caches dependencies when run." description = "Generate a capsule jar that automatically downloads and caches dependencies when run."
applicationClass mainClassName applicationClass mainClassName
destinationDir = buildDir destinationDir = buildDir
} }
task fatCapsule(type: FatCapsule) { task fatCapsule(type: FatCapsule) {
description = "Generate a single capsule jar containing everything. Use -Pfatmain=... to override main class" description = "Generate a single capsule jar containing everything. Use -Pfatmain=... to override main class"
destinationDir = buildDir destinationDir = buildDir
def fatMain = hasProperty('fatmain') ? fatmain : mainClassName def fatMain = hasProperty('fatmain') ? fatmain : mainClassName
applicationClass fatMain applicationClass fatMain
def testJar = hasProperty('test') def testJar = hasProperty('test')
if (hasProperty('fatmain')) { if (hasProperty('fatmain')) {
appendix = "fat-${fatMain}" appendix = "fat-${fatMain}"
} else { } else {
appendix = "fat" appendix = "fat"
} }
if (testJar) { if (testJar) {
from sourceSets.test.output from sourceSets.test.output
} }
} }
} }
/*=================================== /*===================================
* Repositories * Repositories
*===================================*/ *===================================*/
repositories { repositories {
// Prefer the local nexus repository (it may have 3rd party artifacts not found in mavenCentral) // Prefer the local nexus repository (it may have 3rd party artifacts not found in mavenCentral)
maven { maven {
url nexusRepository url nexusRepository
if (isSnapshot) { if (isSnapshot) {
credentials { username credentials { username
password password
username nexusUser username nexusUser
password nexusPassword password nexusPassword
} }
} }
} }
// Use local maven repository // Use local maven repository
mavenLocal() mavenLocal()
// Use 'maven central' for other dependencies. // Use 'maven central' for other dependencies.
mavenCentral() mavenCentral()
} }
task "info" << { task "info" << {
println "Project: ${project.name}" println "Project: ${project.name}"
println "Description: ${project.description}" println "Description: ${project.description}"
println "--------------------------" println "--------------------------"
println "GroupId: $groupId" println "GroupId: $groupId"
println "Version: $version (${isSnapshot ? 'snapshot' : 'release'})" println "Version: $version (${isSnapshot ? 'snapshot' : 'release'})"
println "" println ""
} }
info.description 'Print some information about project parameters' info.description 'Print some information about project parameters'
/*=================================== /*===================================
* Publishing * Publishing
*===================================*/ *===================================*/
publishing { publishing {
publications { publications {
mavenJava(MavenPublication) { mavenJava(MavenPublication) {
groupId project.groupId groupId project.groupId
pom.withXml { pom.withXml {
asNode().appendNode('description', project.description) asNode().appendNode('description', project.description)
} }
from project.components.java from project.components.java
} }
} }
repositories { repositories {
maven { maven {
url "https://cs.idc.ac.il/nexus/content/repositories/${project.isSnapshot ? 'snapshots' : 'releases'}" url "https://cs.idc.ac.il/nexus/content/repositories/${project.isSnapshot ? 'snapshots' : 'releases'}"
credentials { username credentials { username
password password
username nexusUser username nexusUser
password nexusPassword password nexusPassword
} }
} }
} }
} }