Mercurial > public > develkit
annotate artifactory70-github.gradle @ 352:49e02e6dcce6
attempt to publish maven artifacts
author | Marc Davis <marc.davis@mcoecn.org> |
---|---|
date | Tue, 05 Sep 2023 10:41:53 -0400 |
parents | |
children | c203c2024c0d |
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 } |
49e02e6dcce6
attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff
changeset
|
28 mavenJava(MavenPublication) { |
49e02e6dcce6
attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff
changeset
|
29 from components.java |
49e02e6dcce6
attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff
changeset
|
30 } |
49e02e6dcce6
attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff
changeset
|
31 } |
49e02e6dcce6
attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff
changeset
|
32 } |
49e02e6dcce6
attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff
changeset
|
33 } |
49e02e6dcce6
attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff
changeset
|
34 } |
49e02e6dcce6
attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff
changeset
|
35 |
49e02e6dcce6
attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff
changeset
|
36 artifactory { |
49e02e6dcce6
attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff
changeset
|
37 contextUrl = 'https://docker.ssdt.io/artifactory' |
49e02e6dcce6
attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff
changeset
|
38 publish { |
49e02e6dcce6
attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff
changeset
|
39 def isFeature = gradle.branchStream == 'feature' |
49e02e6dcce6
attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff
changeset
|
40 repository { |
49e02e6dcce6
attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff
changeset
|
41 repoKey = isFeature ? 'libs-branches-local' : 'libs-snapshots-local' |
49e02e6dcce6
attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff
changeset
|
42 if (gradle.branch.isRelease()) { |
49e02e6dcce6
attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff
changeset
|
43 repoKey = 'libs-releases-local' |
49e02e6dcce6
attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff
changeset
|
44 } |
49e02e6dcce6
attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff
changeset
|
45 // Publisher username and password |
49e02e6dcce6
attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff
changeset
|
46 // 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
|
47 username = artifactoryUsername |
49e02e6dcce6
attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff
changeset
|
48 password = artifactoryPassword |
49e02e6dcce6
attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff
changeset
|
49 if (isFeature) { |
49e02e6dcce6
attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff
changeset
|
50 ivy { |
49e02e6dcce6
attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff
changeset
|
51 ivyLayout = "${project.gradle.branchHash}/[organization]/[module]/ivy-[revision].xml" |
49e02e6dcce6
attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff
changeset
|
52 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
|
53 mavenCompatible = false |
49e02e6dcce6
attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff
changeset
|
54 } |
49e02e6dcce6
attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff
changeset
|
55 } |
49e02e6dcce6
attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff
changeset
|
56 } |
49e02e6dcce6
attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff
changeset
|
57 defaults { |
49e02e6dcce6
attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff
changeset
|
58 publications('ivyJava') |
49e02e6dcce6
attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff
changeset
|
59 publishBuildInfo = true |
49e02e6dcce6
attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff
changeset
|
60 publishArtifacts = true |
49e02e6dcce6
attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff
changeset
|
61 publishPom = true |
49e02e6dcce6
attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff
changeset
|
62 publishIvy = true |
49e02e6dcce6
attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff
changeset
|
63 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
|
64 } |
49e02e6dcce6
attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff
changeset
|
65 } |
49e02e6dcce6
attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff
changeset
|
66 } |
49e02e6dcce6
attempt to publish maven artifacts
Marc Davis <marc.davis@mcoecn.org>
parents:
diff
changeset
|
67 |