Updated voting-booth-gui build script to work without local nexus repository

android-scanner
Tal Moran 2017-06-21 17:28:07 +03:00
parent 355ea1758b
commit ea8813bade
2 changed files with 38 additions and 56 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 973 B

View File

@ -14,19 +14,18 @@ apply plugin: 'maven-publish'
// (this will also allow you to build a "fatCapsule" which includes
// the entire application, including all dependencies in a single jar)
apply plugin: 'application'
mainClassName='meerkat.voting.gui.Main'
mainClassName='meerkat.voting.gui.VotingBoothToyGraphicalRun'
// Is this a snapshot version?
ext { isSnapshot = false }
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') : ""
groupId = 'org.factcenter.meerkat'
// Credentials for publishing repositories
publishRepository = "https://cs.idc.ac.il/nexus/content/repositories/${project.isSnapshot ? 'snapshots' : 'releases'}"
publishUser = project.hasProperty('publishUser') ? project.property('publishUser') : ""
publishPassword = project.hasProperty('publishPassword') ? project.property('publishPassword') : ""
}
description = "GUI for voting booth"
@ -35,12 +34,12 @@ description = "GUI for voting booth"
version = "0.1"
version += "${isSnapshot ? '-SNAPSHOT' : ''}"
repositories {
flatDir {
dirs '/src/main/resources/jars'
}
}
//
//repositories {
// flatDir {
// dirs '/src/main/resources/jars'
// }
//}
dependencies {
// Meerkat common
@ -138,10 +137,7 @@ idea {
/*===================================
* "Fat" Build targets
*===================================*/
task printProps << {
println fatmain
}
if (project.hasProperty('mainClassName') && (mainClassName != null)) {
@ -156,19 +152,17 @@ if (project.hasProperty('mainClassName') && (mainClassName != null)) {
destinationDir = buildDir
def fatMain
if (this.hasProperty('fatmain')) {
fatMain = fatmain
appendix = "fat-${fatMain}"
} else {
fatMain = mainClassName
appendix = "fat"
}
def fatMain = hasProperty('fatmain') ? fatmain : mainClassName
applicationClass fatMain
def testJar = this.hasProperty('test')
def testJar = hasProperty('test')
if (hasProperty('fatmain')) {
appendix = "fat-${fatMain}"
} else {
appendix = "fat"
}
if (testJar) {
from sourceSets.test.output
@ -176,45 +170,32 @@ if (project.hasProperty('mainClassName') && (mainClassName != null)) {
}
}
/*===================================
* Repositories
*===================================*/
repositories {
// Prefer the local nexus repository (it may have 3rd party artifacts not found in mavenCentral)
maven {
url nexusRepository
if (isSnapshot) {
credentials { username
password
// Use local maven repository
mavenLocal()
username nexusUser
password nexusPassword
}
}
}
// Use local maven repository
mavenLocal()
// Use 'maven central' for other dependencies.
mavenCentral()
// 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'
/*===================================
* Publishing
*===================================*/
@ -232,12 +213,12 @@ publishing {
}
repositories {
maven {
url "https://cs.idc.ac.il/nexus/content/repositories/${project.isSnapshot ? 'snapshots' : 'releases'}"
credentials { username
password
url publishRepository
credentials { username
password
username nexusUser
password nexusPassword
username publishUser
password publishPassword
}
}
}
@ -245,3 +226,4 @@ publishing {