File: generatePom.gradle

package info (click to toggle)
android-platform-frameworks-data-binding 2.2.2-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 17,684 kB
  • sloc: xml: 61,409; java: 34,065; sh: 125; makefile: 10
file content (30 lines) | stat: -rw-r--r-- 780 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
apply plugin: 'maven'

task generatePom {
  outputs.files "${buildDir}/${project.name}.pom"
  assemble.dependsOn generatePom
  clean.doLast {
    delete "${buildDir}/${project.name}.pom"
  }
  doFirst {
    pom {
      project {
        name pomName
        description pomDesc
      }
      whenConfigured {
        setDependencies(getDependencies().toSorted { a, b ->
          if ((a.scope <=> b.scope) != 0) {
            a.scope <=> b.scope
          } else if ((a.groupId <=> b.groupId) != 0) {
            a.groupId <=> b.groupId
          } else if ((a.artifactId <=> b.artifactId) != 0) {
            a.artifactId <=> b.artifactId
          } else {
            a.version <=> b.version
          }
        })
      }
    }.writeTo("${buildDir}/${project.name}.pom")
  }
}