/* * Hibernate, Relational Persistence for Idiomatic Java * * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or . */ buildscript { repositories { jcenter() mavenCentral() } dependencies { classpath 'org.hibernate.build.gradle:hibernate-matrix-testing:3.0.0.Final' classpath 'org.hibernate.build.gradle:version-injection-plugin:1.0.0' classpath 'gradle.plugin.com.github.lburgazzoli:gradle-karaf-plugin:0.5.1' classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.5.7' classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4' classpath 'de.thetaphi:forbiddenapis:3.0.1' classpath 'org.junit.platform:junit-platform-gradle-plugin:1.0.1' } } plugins { id 'io.github.gradle-nexus.publish-plugin' version '1.1.0' id 'nu.studer.credentials' version '2.1' id 'idea' id 'org.jetbrains.gradle.plugin.idea-ext' version '0.5' id 'eclipse' id 'me.champeau.buildscan-recipes' version '0.2.3' id 'org.hibernate.build.xjc' version '2.0.1' apply false id 'biz.aQute.bnd' version '5.1.1' apply false } allprojects { repositories { mavenCentral() //Allow loading additional dependencies from a local path; //useful to load JDBC drivers which can not be distributed in public. if (System.env['ADDITIONAL_REPO'] != null) { flatDir { dirs "${System.env.ADDITIONAL_REPO}" } } } apply from: rootProject.file( 'gradle/base-information.gradle' ) apply plugin: 'idea' apply plugin: 'eclipse' // minimize changes, at least for now (gradle uses 'build' by default).. buildDir = "target" } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Release Task task release { description = "The task performed when we are performing a release build. Relies on " + "the fact that subprojects will appropriately define a release task " + "themselves if they have any release-related activities to perform" doFirst { def javaVersionsInUse = [gradle.ext.javaVersions.main.compiler, gradle.ext.javaVersions.main.release, gradle.ext.javaVersions.test.compiler, gradle.ext.javaVersions.test.release, gradle.ext.javaVersions.test.launcher].toSet() // Force to release with JDK 8. It used to not work on JDK11 because of the hibernate-orm-modules module, // but this limitation might be resolved now that this module has been deleted? if ( javaVersionsInUse != [JavaLanguageVersion.of( 8 )].toSet() ) { throw new IllegalStateException( "Please use JDK 8 to perform the release. Currently using: ${javaVersionsInUse}" ) } } } task publish { description = "The task performed when we want to just publish maven artifacts. Relies on " + "the fact that subprojects will appropriately define a release task " + "themselves if they have any release-related activities to perform" } ext { // look for command-line overrides of the username/password pairs for publishing if ( project.hasProperty( 'hibernatePublishUsername' ) ) { credentials.hibernatePublishUsername = project.property( 'hibernatePublishUsername' ) } if ( project.hasProperty( 'hibernatePublishPassword' ) ) { credentials.hibernatePublishPassword = project.property( 'hibernatePublishPassword' ) } if ( project.hasProperty( 'hibernateSnapshotsUsername' ) ) { credentials.hibernateSnapshotsUsername = project.property( 'hibernateSnapshotsUsername' ) } if ( project.hasProperty( 'hibernateSnapshotsPassword' ) ) { credentials.hibernateSnapshotsPassword = project.property( 'hibernateSnapshotsPassword' ) } } gradle.taskGraph.addTaskExecutionGraphListener( new TaskExecutionGraphListener() { @Override void graphPopulated(TaskExecutionGraph graph) { // make sure the needed username/password pair is available based on whether // we are trying to perform a release or snapshot publishing (if either) if ( graph.hasTask( 'publishMavenJavaPublicationToSnapshotRepository' ) ) { if ( ! project.hcannVersion.isSnapshot ) { throw new GradleException("Cannot publish non-snapshot version to snapshot repository"); } if ( project.credentials.hibernateSnapshotsUsername == null ) { throw new GradleException("Snapshot publishing credentials not specified"); } } if (graph.hasTask('publishMavenJavaPublicationToOssrhRepository')) { if ( project.hcannVersion.isSnapshot ) { throw new GradleException("Cannot publish snapshot version to non-snapshot repository"); } if (project.credentials.hibernatePublishUsername == null) { throw new GradleException("Publishing credentials not specified"); } } } } ) nexusPublishing { repositories { sonatype { username = project.credentials.hibernatePublishUsername password = project.credentials.hibernatePublishPassword } } } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // CI Build Task task ciBuild { description = "The task performed when one of the 'main' jobs are triggered on the " + "CI server. Just as above, relies on the fact that subprojects will " + "appropriately define a release task themselves if they have any tasks " + "which should be performed from these CI jobs" } // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Misc... wrapper { // To upgrade the version of gradle used in the wrapper, run: // ./gradlew wrapper --gradle-version NEW_VERSION distributionType = Wrapper.DistributionType.ALL } buildScan { termsOfServiceUrl = 'https://gradle.com/terms-of-service' termsOfServiceAgree = 'yes' } buildScanRecipes { recipe 'git-commit', baseUrl: 'https://github.com/hibernate/hibernate-orm/tree' } idea { // project { // jdkName = gradle.ext.baselineJavaVersion // languageLevel = gradle.ext.baselineJavaVersion // // vcs = 'Git' // // settings { // taskTriggers { // afterSync tasks.getByName("projects"), tasks.getByName("tasks") // } // } // } module { name = "hibernate-orm" } }