Gradle build clean-ups

- drop use of `allprojects`
This commit is contained in:
Steve Ebersole 2022-03-15 09:39:07 -05:00
parent a8d9d4e5ef
commit 92b46bca5b
7 changed files with 56 additions and 101 deletions

View File

@ -33,27 +33,7 @@ plugins {
id 'eclipse'
}
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: 'org.hibernate.orm.database-service'
apply plugin: 'idea'
apply plugin: 'eclipse'
// minimize changes, at least for now (gradle uses 'build' by default)..
buildDir = "target"
}
apply from: file( 'gradle/module.gradle' )
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -77,7 +57,7 @@ task release {
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"
"themselves if they have any publish-related activities to perform"
}
ext {
@ -161,18 +141,6 @@ wrapper {
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"
}

View File

@ -9,7 +9,32 @@
// Applies details for `https://ge.hibernate.org`
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
apply from: file( 'system-information.gradle' )
ext {
isCiEnvironment = isJenkins() || isGitHubActions() || isGenericCi()
populateRemoteBuildCache = getSetting( "POPULATE_REMOTE" ).isPresent()
}
private static boolean isJenkins() {
return getSetting( "JENKINS_URL" ).isPresent()
}
private static boolean isGitHubActions() {
return getSetting( "GITHUB_ACTIONS" ).isPresent()
}
private static boolean isGenericCi() {
return System.getenv("CI") != null || System.getProperty("CI") != null
}
static java.util.Optional<String> getSetting(String name) {
def envVar = System.getenv(name)
if ( envVar != null ) {
return java.util.Optional.of(envVar);
}
def sysProp = System.getProperty(name)
return java.util.Optional.ofNullable(sysProp);
}
gradleEnterprise {
server = 'https://ge.hibernate.org'

View File

@ -1,30 +0,0 @@
/*
* 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 http://www.gnu.org/licenses/lgpl-2.1.html
*/
apply plugin: 'org.hibernate.orm.jakarta'
apply from: rootProject.file( 'gradle/libraries.gradle' )
apply from: rootProject.file( 'gradle/databases.gradle' )
apply plugin: 'org.hibernate.orm.database-service'
apply plugin: 'build-dashboard'
apply plugin: 'project-report'
configurations {
jakartaeeTransformTool {
description = 'JakartaTransformer tool dependencies'
}
}
dependencies {
jakartaeeTransformTool 'org.eclipse.transformer:org.eclipse.transformer:0.2.0'
jakartaeeTransformTool 'org.eclipse.transformer:org.eclipse.transformer.cli:0.2.0'
}
tasks.withType( Test ) { test ->
test.usesService( project.gradle.sharedServices.registrations.getByName( 'databaseService' ).service )
}

View File

@ -21,9 +21,12 @@ buildscript {
import de.thetaphi.forbiddenapis.gradle.CheckForbiddenApis
import org.apache.tools.ant.filters.ReplaceTokens
apply from: rootProject.file( 'gradle/module.gradle' )
apply from: rootProject.file( 'gradle/libraries.gradle' )
apply from: rootProject.file( 'gradle/databases.gradle' )
apply plugin: 'org.hibernate.orm.database-service'
apply plugin: 'java-library'
apply plugin: 'org.hibernate.orm.database-service'

9
gradle/module.gradle Normal file
View File

@ -0,0 +1,9 @@
// Applied to all projects
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"

View File

@ -1,34 +0,0 @@
/*
* 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 http://www.gnu.org/licenses/lgpl-2.1.html
*/
apply from: rootProject.file( 'gradle/jakarta-java-module.gradle' )
apply from: rootProject.file( 'gradle/publishing-pom.gradle' )
apply plugin: 'org.hibernate.orm.jakarta-publish'
publishing {
publications {
publishedArtifacts {
from components.jakarta
}
}
}
//java {
// withJavadocJar()
// withSourcesJar()
//}
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Release / publishing tasks
task ciBuild( dependsOn: [test, publish] )
task release(dependsOn: [test, publishToSonatype])
publishToSonatype.mustRunAfter test

View File

@ -20,9 +20,21 @@ plugins {
id 'com.gradle.common-custom-user-data-gradle-plugin' version '1.4.2'
}
rootProject.name = 'hibernate-orm'
dependencyResolutionManagement {
repositories {
mavenCentral()
includeBuild('hibernate-orm-build')
//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}"
}
}
}
}
rootProject.name = 'hibernate-orm'
apply from: file( 'gradle/gradle-enterprise.gradle' )
@ -115,6 +127,8 @@ else {
logger.lifecycle "Java versions for main code: " + gradle.ext.javaVersions.main
logger.lifecycle "Java versions for tests: " + gradle.ext.javaVersions.test
includeBuild('hibernate-orm-build')
include 'hibernate-core'
include 'hibernate-testing'