view artifactory70.gradle @ 336:6258c89efe9e

add a new init70 for github actions
author marc_davis <davis@ssdt-ohio.org>
date Tue, 30 May 2023 12:54:59 -0400
parents 7ca1fbf8636a
children de8c350c511a
line wrap: on
line source

logger.info("applying SSDT bamboo/artifactory Gradle Settings")

buildscript {
    repositories {
//        maven { url 'https://docker.ssdt.io/artifactory/gradle-plugins' }
        mavenCentral()
    }
    dependencies {
        classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.28.4"
    }
}

//apply plugin: org.jfrog.gradle.plugin.artifactory.ArtifactoryConfigurationsPlugin

allprojects {
    apply plugin: org.jfrog.gradle.plugin.artifactory.ArtifactoryPlugin
    apply plugin: 'ivy-publish'
    apply plugin: 'java'

    afterEvaluate {
        publishing {
            publications {
                ivyJava(IvyPublication) {
                    from components.java
                }
            }
        }
    }
}

artifactory {
    contextUrl = 'https://docker.ssdt.io/artifactory'
    publish {
        def isFeature = gradle.branchStream == 'feature'
        repository {
            repoKey = isFeature ? 'libs-branches-local' : 'libs-snapshots-local'
            if (gradle.branch.isRelease()) {
                repoKey = 'libs-releases-local'
            }
            // Publisher username and password
            // Sub projects must provide these values via command line or properties file
            username = artifactoryUsername
            password = artifactoryPassword
            if (isFeature) {
                ivy {
                    ivyLayout = "${project.gradle.branchHash}/[organization]/[module]/ivy-[revision].xml"
                    artifactLayout = "${project.gradle.branchHash}/[organization]/[module]/[revision]/[module]-[revision](-[classifier]).[ext]"
                    mavenCompatible = false
                }
            }
        }
        defaults {
            publications('ivyJava')
            publishBuildInfo = true
            publishArtifacts = true
            publishPom = false
            publishIvy = true
            properties = [ 'ssdt-branch.branchName': gradle.branchName.replaceAll('/','-'), 'ssdt-branch.branchStream': gradle.branchStream ]
        }
    }
}