Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

License inconsistency fix , Update bintray-release info and Append license… #309

Merged
merged 1 commit into from
Apr 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
License inconsistency, Update bintray-release info and Append license…
… to pom xml file

Also bumped version
  • Loading branch information
Andrew Beck committed Apr 16, 2020
commit e51732a505486c1ac6cd5d0863d24efa02221de8
40 changes: 40 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,43 @@ allprojects {
task clean(type: Delete) {
delete rootProject.buildDir
}

subprojects {
if (project.getGradle().startParameter.taskNames.any{it.contains('bintrayUpload')} && project.name in ['tableview']) {
println project.name
apply plugin: 'maven'

gradle.taskGraph.whenReady { taskGraph ->
def pomTask = taskGraph.getAllTasks().find {
it.path == ":$project.name:generatePomFileForReleasePublication"
}
if (pomTask == null) println 'pomTask null'
if (pomTask == null) return
pomTask.doLast {
println 'Updating pom-file(s) with License info'
pomTask.outputs.files
.filter { File file ->
file.path.contains("publications") && file.name.matches("^pom-.+\\.xml\$")
}
.forEach { File file -> addLicense(file) }
}
}
}
}

static void addLicense(File pom) {
def licenseNode = new Node(null, "license")
licenseNode.append(new Node(null, "name", "MIT"))
licenseNode.append(new Node(null, "url", "https://github.com/evrencoskun/TableView/blob/master/LICENSE"))
def licensesNode = new Node(null, "licenses")
licensesNode.append(licenseNode)

def xml = new XmlParser().parse(pom)
xml.append(licensesNode)

def writer = new PrintWriter(new FileWriter(pom))
def printer = new XmlNodePrinter(writer)
printer.preserveWhitespace = true
printer.print(xml)
writer.close()
}
3 changes: 2 additions & 1 deletion tableview/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ publish {
userOrg = 'evrencoskun' //user name of bintray.com
groupId = 'com.evrencoskun.library' //jcenter's url
artifactId = 'tableview' //project name
publishVersion = '0.8.9.2' //version code
publishVersion = '0.8.9.3' //version code
desc = 'TableView is a powerful Android library for displaying complex data structures and rendering tabular data composed of rows, columns and cells.'
website = 'https://github.com/evrencoskun/TableView' //website
licences = ['MIT']
}