Skip to content
Open
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
3 changes: 3 additions & 0 deletions .release/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# The folder into which we checkout our release scripts into
*
!.gitignore
120 changes: 26 additions & 94 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,117 +2,49 @@ buildscript {
repositories {
mavenCentral()
mavenLocal()

mavenRepo name: 'jboss-nexus', url: "http://repository.jboss.org/nexus/content/groups/public/"
mavenRepo name: "jboss-snapshots", url: "http://snapshots.jboss.org/maven2/"
}
dependencies {
classpath 'org.hibernate.build.gradle:gradle-maven-publish-auth:2.0.1'
}
}

plugins {
id 'java-gradle-plugin'
// publishing
id "com.gradle.plugin-publish" version "1.2.1"
}

repositories {
mavenCentral()
mavenLocal()
mavenRepo name: "jboss", url: "http://repository.jboss.org/nexus/content/groups/public/"
}

apply plugin: 'groovy'
apply plugin: 'maven-publish'
apply plugin: 'maven-publish-auth'

apply plugin: 'idea'
apply plugin: 'eclipse'

group = 'org.hibernate.build.gradle'
version = '1.0.1-SNAPSHOT'

buildDir = "target"

dependencies {
compile gradleApi()
compile localGroovy()
compile 'org.javassist:javassist:3.18.1-GA'
compileOnly gradleApi()
implementation 'org.javassist:javassist:3.30.2-GA'
}


task sourcesJar(type: Jar, dependsOn: compileJava) {
from sourceSets.main.allSource
classifier = 'sources'
java {
withSourcesJar()
withJavadocJar()
}

publishing {
publications {
mavenJava(MavenPublication) {
from components.java

artifact sourcesJar {
classifier "sources"
}

pom.withXml {
// append additional metadata
asNode().children().last() + {
resolveStrategy = Closure.DELEGATE_FIRST
name 'Version Injection Plugin for Gradle'
description 'Gradle plugin for dynamic injection of the project version into classes (bytecode manipulation)'
url 'http://hibernate.org'
organization {
name 'Hibernate.org'
url 'http://hibernate.org'
}
scm {
url 'http://github.com/hibernate/version-injection-plugin'
connection 'scm:git:http://github.com/hibernate/version-injection-plugin.git'
developerConnection 'scm:git:[email protected]:hibernate/version-injection-plugin.git'
}
licenses {
license {
name 'GNU Lesser General Public License'
url 'http://www.gnu.org/licenses/lgpl-2.1.html'
comments 'See discussion at http://hibernate.org/license for more details.'
distribution 'repo'
}
}
developers {
developer {
id 'sebersole'
name 'Steve Ebersole'
organization 'Hibernate.org'
organizationUrl 'http://hibernate.org'
}
}
}

// TEMPORARY : currently Gradle Publishing feature is exporting dependencies as 'runtime' scope,
// rather than 'compile'; fix that.
asNode().dependencies[0].dependency.each {
it.scope[0].value = 'compile'
}
}
}
}
tasks.withType(JavaCompile).configureEach {
sourceCompatibility = '11'
targetCompatibility = '11'
}

repositories {
maven {
if ( version.endsWith( 'SNAPSHOT' ) ) {
name 'jboss-snapshots-repository'
url 'https://repository.jboss.org/nexus/content/repositories/snapshots'
}
else {
name 'jboss-releases-repository'
url 'https://repository.jboss.org/nexus/service/local/staging/deploy/maven2/'
}
gradlePlugin {
website = "https://github.com/hibernate/version-injection-plugin"
vcsUrl = "https://github.com/hibernate/version-injection-plugin"

plugins {
injection {
id = 'org.hibernate.build.version-injection'
implementationClass = "org.hibernate.build.gradle.inject.InjectionPlugin"
displayName = "Version Injection Plugin"
description = "Gradle plugin for performing injection of the project's version into the bytecode of one or more members"
tags.set( [ "version-injection" ] )
}
}

generatePomFileForMavenJavaPublication {
destination = file("$buildDir/generated-pom.xml")
}

}


task wrapper(type: Wrapper) {
gradleVersion = '1.7'
}
83 changes: 83 additions & 0 deletions ci/release/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
/*
* SPDX-License-Identifier: Apache-2.0
* Copyright Red Hat Inc. and Hibernate Authors
*/

@Library('hibernate-jenkins-pipeline-helpers') _

import org.hibernate.jenkins.pipeline.helpers.version.Version

pipeline {
agent {
label 'Release'
}
tools {
jdk 'OpenJDK 21 Latest'
}
options {
buildDiscarder logRotator(daysToKeepStr: '30', numToKeepStr: '10')
disableConcurrentBuilds(abortPrevious: false)
}
parameters {
string(
name: 'RELEASE_VERSION',
defaultValue: '',
description: 'The version to be released, e.g. 3.0.0.Final.',
trim: true
)
string(
name: 'DEVELOPMENT_VERSION',
defaultValue: '',
description: 'The next version to be used after the release, e.g. 3.0.0-SNAPSHOT.',
trim: true
)
}
stages {
stage('Release') {
when {
beforeAgent true
// Releases must be triggered explicitly
// This is just for safety; normally the Jenkins job for this pipeline
// should be configured to "Suppress automatic SCM triggering"
// See https://stackoverflow.com/questions/58259326/prevent-jenkins-multibranch-pipeline-from-triggering-builds-for-new-branches
triggeredBy cause: "UserIdCause"
}
steps {
script {
// Check that all the necessary parameters are set
if (!params.RELEASE_VERSION) {
throw new IllegalArgumentException("Missing value for parameter RELEASE_VERSION.")
}
if (!params.DEVELOPMENT_VERSION) {
throw new IllegalArgumentException("Missing value for parameter DEVELOPMENT_VERSION.")
}

def releaseVersion = Version.parseReleaseVersion(params.RELEASE_VERSION, Version.Scheme.JBOSS_NO_FINAL)
def developmentVersion = Version.parseDevelopmentVersion(params.DEVELOPMENT_VERSION)

echo "Performing full release for version ${releaseVersion.toString()}"

withMaven(mavenSettingsConfig: params.RELEASE_DRY_RUN ? null : 'ci-hibernate.deploy.settings.maven',
mavenLocalRepo: env.WORKSPACE_TMP + '/.m2repository') {
withCredentials([usernamePassword(credentialsId: 'gradle-plugin-portal-api-key', passwordVariable: 'GRADLE_PUBLISH_SECRET', usernameVariable: 'GRADLE_PUBLISH_KEY'),
gitUsernamePassword(credentialsId: 'username-and-token.Hibernate-CI.github.com', gitToolName: 'Default')]) {
dir('.release/scripts') {
sh 'git clone https://github.com/hibernate/hibernate-release-scripts.git .'
}

sh "bash -xe .release/scripts/prepare-release.sh -j -b ${env.GIT_BRANCH} -v ${params.DEVELOPMENT_VERSION} infra-gradle-plugin ${params.RELEASE_VERSION}"
sh "./gradlew publishPlugins"
sh "bash -xe .release/scripts/update-version.sh infra-gradle-plugin ${params.DEVELOPMENT_VERSION}"
sh "bash -xe .release/scripts/push-upstream.sh infra-gradle-plugin ${params.RELEASE_VERSION} true"
}
}
}
}
}
}
post {
always {
notifyBuildResult notifySuccessAfterSuccess: true, maintainers: '[email protected]'
}
}
}
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
version=2.1.0-SNAPSHOT
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 3 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#Tue Sep 10 13:28:36 CDT 2013
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=http\://services.gradle.org/distributions/gradle-1.7-bin.zip
Loading