annotate artifactory70-github.gradle @ 354:23617a92ae36

try setting the group id with the branch hash
author Marc Davis <marc.davis@mcoecn.org>
date Tue, 05 Sep 2023 13:26:06 -0400
parents c203c2024c0d
children
rev   line source
352
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
1
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
2 logger.info("applying SSDT bamboo/artifactory Gradle Settings")
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
3
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
4 buildscript {
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
5 repositories {
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
6 // maven { url 'https://docker.ssdt.io/artifactory/gradle-plugins' }
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
7 mavenCentral()
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
8 }
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
9 dependencies {
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
10 classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.28.4"
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
11 }
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
12 }
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
13
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
14 //apply plugin: org.jfrog.gradle.plugin.artifactory.ArtifactoryConfigurationsPlugin
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
15
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
16 allprojects {
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
17 apply plugin: org.jfrog.gradle.plugin.artifactory.ArtifactoryPlugin
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
18 apply plugin: 'ivy-publish'
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
19 apply plugin: 'maven-publish'
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
20 apply plugin: 'java'
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
21
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
22 afterEvaluate {
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
23 publishing {
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
24 publications {
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
25 ivyJava(IvyPublication) {
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
26 from components.java
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
27 }
354
23617a92ae36 try setting the group id with the branch hash
Marc Davis <marc.davis@mcoecn.org>
parents: 353
diff changeset
28
23617a92ae36 try setting the group id with the branch hash
Marc Davis <marc.davis@mcoecn.org>
parents: 353
diff changeset
29 if (gradle.branchStream == 'feature') {
23617a92ae36 try setting the group id with the branch hash
Marc Davis <marc.davis@mcoecn.org>
parents: 353
diff changeset
30 mavenJava(MavenPublication) {
23617a92ae36 try setting the group id with the branch hash
Marc Davis <marc.davis@mcoecn.org>
parents: 353
diff changeset
31 from components.java
23617a92ae36 try setting the group id with the branch hash
Marc Davis <marc.davis@mcoecn.org>
parents: 353
diff changeset
32 group = "${project.gradle.branchHash}/${project.getGroup()}"
23617a92ae36 try setting the group id with the branch hash
Marc Davis <marc.davis@mcoecn.org>
parents: 353
diff changeset
33 }
23617a92ae36 try setting the group id with the branch hash
Marc Davis <marc.davis@mcoecn.org>
parents: 353
diff changeset
34 } else {
23617a92ae36 try setting the group id with the branch hash
Marc Davis <marc.davis@mcoecn.org>
parents: 353
diff changeset
35 mavenJava(MavenPublication) {
23617a92ae36 try setting the group id with the branch hash
Marc Davis <marc.davis@mcoecn.org>
parents: 353
diff changeset
36 from components.java
23617a92ae36 try setting the group id with the branch hash
Marc Davis <marc.davis@mcoecn.org>
parents: 353
diff changeset
37 }
352
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
38 }
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
39 }
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
40 }
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
41 }
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
42 }
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
43
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
44 artifactory {
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
45 contextUrl = 'https://docker.ssdt.io/artifactory'
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
46 publish {
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
47 def isFeature = gradle.branchStream == 'feature'
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
48 repository {
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
49 repoKey = isFeature ? 'libs-branches-local' : 'libs-snapshots-local'
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
50 if (gradle.branch.isRelease()) {
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
51 repoKey = 'libs-releases-local'
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
52 }
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
53 // Publisher username and password
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
54 // Sub projects must provide these values via command line or properties file
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
55 username = artifactoryUsername
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
56 password = artifactoryPassword
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
57 if (isFeature) {
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
58 ivy {
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
59 ivyLayout = "${project.gradle.branchHash}/[organization]/[module]/ivy-[revision].xml"
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
60 artifactLayout = "${project.gradle.branchHash}/[organization]/[module]/[revision]/[module]-[revision](-[classifier]).[ext]"
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
61 mavenCompatible = false
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
62 }
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
63 }
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
64 }
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
65 defaults {
353
c203c2024c0d attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents: 352
diff changeset
66 publications('ivyJava', 'mavenJava')
352
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
67 publishBuildInfo = true
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
68 publishArtifacts = true
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
69 publishPom = true
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
70 publishIvy = true
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
71 properties = [ 'ssdt-branch.branchName': gradle.branchName.replaceAll('/','-'), 'ssdt-branch.branchStream': gradle.branchStream ]
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
72 }
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
73 }
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
74 }
49e02e6dcce6 attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff changeset
75