-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove avro-fastserde's declared dependency on helper from pom (#34)
Co-authored-by: Radai Rosenblatt <[email protected]>
- Loading branch information
1 parent
9c499da
commit 7ae6344
Showing
2 changed files
with
122 additions
and
1 deletion.
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 |
---|---|---|
@@ -1,3 +1,9 @@ | ||
/* | ||
* Copyright 2020 LinkedIn Corp. | ||
* Licensed under the BSD 2-Clause License (the "License"). | ||
* See License in the project root for license information. | ||
*/ | ||
|
||
plugins { | ||
id "java-library" | ||
} | ||
|
@@ -145,3 +151,117 @@ cleanupAndRebuildTestsForAvro18.dependsOn generateAvroClasses18 | |
testAvro14.dependsOn cleanupAndRebuildTestsForAvro14 | ||
testAvro17.dependsOn cleanupAndRebuildTestsForAvro17 | ||
testAvro18.dependsOn cleanupAndRebuildTestsForAvro18 | ||
|
||
//custom publishing code to export a depndency on "helper-all": | ||
|
||
task sourceJar(type: Jar) { | ||
from sourceSets.main.allJava | ||
classifier "sources" | ||
} | ||
|
||
task javadocJar(type: Jar) { | ||
from javadoc | ||
classifier = 'javadoc' | ||
} | ||
|
||
task testJar(type: Jar) { | ||
from sourceSets.test.allJava | ||
classifier = 'tests' | ||
} | ||
|
||
publishing { | ||
publications { | ||
"$project.name"(MavenPublication) { | ||
groupId project.group | ||
artifactId project.name | ||
version project.version | ||
|
||
from components.java | ||
artifact sourceJar | ||
artifact javadocJar | ||
artifact testJar | ||
|
||
//we strive to meet https://central.sonatype.org/pages/requirements.html | ||
pom { | ||
name = 'Avro Util' | ||
description = 'utilities for writing code that works across major avro versions' | ||
url = 'https://github.com/linkedin/avro-util' | ||
|
||
licenses { | ||
license { | ||
name = 'BSD 2-Clause' | ||
url = 'https://raw.githubusercontent.com/linkedin/avro-util/master/LICENSE' | ||
} | ||
} | ||
developers { | ||
developer { | ||
id = 'radai-rosenblatt' | ||
name = 'Radai Rosenblatt' | ||
email = '[email protected]' | ||
organization = 'LinkedIn' | ||
organizationUrl = 'linkedin.com' | ||
} | ||
developer { | ||
id = 'abhishekmendhekar' | ||
name = 'Abhishek Mendhekar' | ||
organization = 'LinkedIn' | ||
organizationUrl = 'linkedin.com' | ||
} | ||
developer { | ||
id = 'jimhe' | ||
name = 'Jim He' | ||
email = '[email protected]' | ||
organization = 'LinkedIn' | ||
organizationUrl = 'linkedin.com' | ||
} | ||
developer { | ||
id = 'ghosthack' | ||
name = 'Adrian Fernandez' | ||
email = '[email protected]' | ||
organization = 'LinkedIn' | ||
organizationUrl = 'linkedin.com' | ||
} | ||
} | ||
scm { | ||
connection = 'scm:git:git://github.com:linkedin/avro-util.git' | ||
developerConnection = 'scm:git:ssh://github.com:linkedin/avro-util.git' | ||
url = 'https://github.com/linkedin/avro-util' | ||
} | ||
} | ||
|
||
//remove the dependency on helper, and replace with one on helper-all | ||
pom.withXml { | ||
Node dependenciesNode = (Node) (asNode().dependencies[0]) | ||
Collection<Node> dependencyNodes = dependenciesNode.children() | ||
List<Node> toRemove = new ArrayList<>() | ||
|
||
for (Node o : dependencyNodes) { | ||
if ("$project.group" == o.groupId[0].text() && "helper" == o.artifactId[0].text()) { | ||
toRemove.add(o) | ||
} | ||
} | ||
|
||
for (Node o : toRemove) { | ||
dependencyNodes.remove(o) | ||
} | ||
|
||
def dependencyNode = dependenciesNode.appendNode('dependency') | ||
dependencyNode.appendNode('groupId', "$project.group") | ||
dependencyNode.appendNode('artifactId', "helper-all") | ||
dependencyNode.appendNode('version', "$project.version") | ||
dependencyNode.appendNode('scope', "compile") | ||
} | ||
} | ||
|
||
//record all of this module's publications in the bintray publications list | ||
//for the root project | ||
List<String> allPublicationNames = new ArrayList<>(Arrays.asList(rootProject.bintray.publications)) | ||
List<String> projectAndDepPublicationNames = new ArrayList<>(project.publishing.publications.names) | ||
for (String projectPubName : projectAndDepPublicationNames) { | ||
if (!allPublicationNames.contains(projectPubName)) { | ||
allPublicationNames.add(projectPubName) | ||
} | ||
} | ||
rootProject.bintray.publications = allPublicationNames.toArray() | ||
} | ||
} |
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