This repository has been archived by the owner on Sep 15, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added task for publishing to artifactory
Fernando Hernandez
committed
Feb 9, 2015
1 parent
20dda02
commit 57a7875
Showing
154 changed files
with
193 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,7 @@ dist | |
*.iml | ||
*.ipr | ||
*.iws | ||
|
||
# where gradle properties are stored | ||
gradle.properties | ||
.gradle/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,149 @@ | ||
apply plugin: 'java' | ||
apply plugin: 'idea' | ||
|
||
buildscript { | ||
repositories { | ||
maven { | ||
url "http://jcenter.bintray.com" | ||
} | ||
|
||
dependencies { | ||
classpath(group: 'org.jfrog.buildinfo', name: 'build-info-extractor-gradle', version: '2.2.5') | ||
} | ||
} | ||
} | ||
|
||
task wrapper(type: Wrapper) { | ||
gradleVersion = '2.0' | ||
} | ||
|
||
allprojects { | ||
group = "com.complexible.common" | ||
sourceCompatibility = '1.7' | ||
targetCompatibility = '1.7' | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
|
||
} | ||
|
||
ext { | ||
projectDescription = "A collection of basic utility classes for various common tasks. " + | ||
"Classes provided here often extend or supplement the functionality provided by Guava." | ||
projectUrl = "https://github.com/mhgrove/cp-common-utils" | ||
} | ||
|
||
subprojects { | ||
apply plugin: "java" | ||
apply plugin: "maven" | ||
apply plugin: "artifactory" | ||
|
||
dependencies { | ||
compile 'org.slf4j:slf4j-api:1.7.5' | ||
compile 'org.slf4j:slf4j-jdk14:1.7.5' | ||
|
||
testCompile 'junit:junit:4.11' | ||
} | ||
|
||
sourceSets { | ||
main { | ||
java { | ||
srcDir 'main/src' | ||
} | ||
resources { | ||
srcDir 'main/resources' | ||
} | ||
} | ||
test { | ||
java { | ||
srcDir 'test/src' | ||
} | ||
resources { | ||
srcDir 'test/resources' | ||
} | ||
} | ||
} | ||
|
||
// create a 'tests' conf for importing test classes from other sub-projects | ||
task testJar(type: Jar, dependsOn: testClasses) { | ||
classifier = 'tests' | ||
from sourceSets.test.output | ||
} | ||
|
||
artifacts { | ||
testRuntime testJar // include the tests of other subprojects | ||
} | ||
|
||
if (project.hasProperty('publishUrl') | ||
&& project.hasProperty('artifactoryUser') | ||
&& project.hasProperty('artifactoryPassword')) { | ||
|
||
// this task is just so artifactory picks up the pom changes | ||
task('uploadMvn', type: Upload) { | ||
configuration = configurations.archives | ||
repositories { | ||
mavenDeployer { | ||
repository(url: publishUrl) | ||
pom.project { | ||
name = archivesBaseName | ||
packaging = 'jar' | ||
description projectDescription | ||
url projectUrl | ||
} | ||
|
||
//mess with the generated pom to remove test dependencies from published artifacts | ||
pom.withXml { XmlProvider xmlProvider -> | ||
def xml = xmlProvider.asString() | ||
def pomXml = new XmlParser().parse(new ByteArrayInputStream(xml.toString().bytes)) | ||
|
||
pomXml.dependencies.dependency.each { dep -> | ||
if (dep.scope.text() != 'compile') { | ||
def parent = dep.parent() | ||
parent.remove(dep) | ||
} | ||
} | ||
|
||
def newXml = new StringWriter() | ||
def printer = new XmlNodePrinter(new PrintWriter(newXml)) | ||
printer.preserveWhitespace = true | ||
printer.print(pomXml) | ||
xml.setLength(0) | ||
xml.append(newXml.toString()) | ||
} | ||
|
||
} | ||
} | ||
} | ||
|
||
artifactory { | ||
// publishUrl is defined in gradle.properties | ||
publish { | ||
contextUrl = publishUrl | ||
repository { | ||
repoKey = 'stardog-mvn' //The Artifactory repository key to publish to | ||
username = "${artifactoryUser}" //The publisher user name | ||
password = "${artifactoryPassword}" //The publisher password | ||
} | ||
} | ||
resolve { | ||
contextUrl = publishUrl | ||
repository { | ||
repoKey = 'stardog-mvn' //The Artifactory (preferably virtual) repository key to resolve from | ||
username = "${artifactoryUser}" //Optional resolver user name (leave out to use anonymous resolution) | ||
password = "${artifactoryPassword}" //The resolver password | ||
maven = true | ||
} | ||
} | ||
|
||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
compile project(":core") | ||
compile project(":protobuf") | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
group = "com.complexible.common.core" | ||
version = "4.0" | ||
archivesBaseName = "cp-common-utils" | ||
|
||
dependencies { | ||
compile (group: "com.google.guava", name: "guava", version: "18.0") { | ||
exclude group: "com.google.code.findbugs" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,4 +26,4 @@ | |
*/ | ||
public interface BinaryFunction<Arg1,Arg2,Output> { | ||
public Output apply(Arg1 theArg1, Arg2 theArg2); | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -115,4 +115,4 @@ private static long parseDuration(String theStr, TimeUnit theUnit) { | |
} | ||
return theUnit.toMillis(aVal); | ||
} | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -102,4 +102,4 @@ public void close() throws OE { | |
throw wrapException(e); | ||
} | ||
} | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -214,4 +214,4 @@ public static void main(String[] args) { | |
t.printStackTrace(); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -101,4 +101,4 @@ public int compare(T o1, T o2) { | |
|
||
return n1 - n2; | ||
} | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
publishUrl=/url/to/repo | ||
artifactoryUser=user | ||
artifactoryPassword=secret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
group = "com.complexible.common.protobuf" | ||
version = "1.2" | ||
archivesBaseName = "cp-common-protobuf" | ||
|
||
dependencies { | ||
compile "com.google.protobuf:protobuf-java:2.5.0" | ||
|
||
compile project(":core") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,4 +73,4 @@ public T read() throws InvalidProtocolBufferException, IOException { | |
return null; | ||
} | ||
} | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
rootProject.name = "common-utils" | ||
|
||
include "core", "protobuf" |