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
25 changes: 13 additions & 12 deletions documentation/documentation.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
* SPDX-License-Identifier: Apache-2.0
* Copyright Red Hat Inc. and Hibernate Authors
*/
import java.util.function.Function

import org.asciidoctor.gradle.jvm.AsciidoctorTask
import org.asciidoctor.gradle.jvm.pdf.AsciidoctorPdfTask
import org.ysb33r.grolifant.api.core.jvm.ExecutionMode

import java.util.function.Function

buildscript {
configurations.configureEach {
resolutionStrategy.dependencySubstitution {
Expand Down Expand Up @@ -714,16 +715,14 @@ settingsDocumentation {
def generateSettingsDocTask = tasks.named( "generateSettingsDoc" ) {
dependsOn aggregateJavadocsTask

doFirst {
def javadoc = aggregateJavadocsTask.get()
def javaLanguageVersion = javadoc.javadocTool.present
? javadoc.javadocTool.get().metadata.languageVersion
: JavaLanguageVersion.of( JavaVersion.current().name )
def javadoc = aggregateJavadocsTask.get()
def javaLanguageVersion = javadoc.javadocTool.present
? javadoc.javadocTool.get().metadata.languageVersion
: JavaLanguageVersion.of( JavaVersion.current().name )

if ( javaLanguageVersion.asInt() > 11 ) {
println "Aggregated Javadocs was built using a JDK newer than version 11; generating the settings User Guide fragment will not succeed"
}
}
if ( javaLanguageVersion.asInt() > 11 ) {
println "Aggregated Javadocs was built using a JDK newer than version 11; generating the settings User Guide fragment will not succeed"
}
}

def renderUserGuideHtmlTask = tasks.register( 'renderUserGuideHtml', AsciidoctorTask ) { task ->
Expand Down Expand Up @@ -969,7 +968,8 @@ def buildDocsForPublishingTask = tasks.register( 'buildDocsForPublishing' ) { ta

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tasks.withType(AsciidoctorTask).configureEach {
tasks.withType( AsciidoctorTask ).configureEach {
notCompatibleWithConfigurationCache( "AsciiDoctor v4 is not compatible with CC yet, remove with stable release of v5" )
baseDirFollowsSourceDir()
outputOptions {
separateOutputDirs = false
Expand All @@ -981,7 +981,8 @@ tasks.withType(AsciidoctorTask).configureEach {
dependsOn 'unpackTheme'
}

tasks.withType(AsciidoctorPdfTask).configureEach {
tasks.withType( AsciidoctorPdfTask ).configureEach {
notCompatibleWithConfigurationCache( "AsciiDoctor v4 is not compatible with CC yet, remove with stable release of v5" )
// See https://docs.asciidoctor.org/gradle-plugin/latest/common-task-configuration/#choosing-an-execution-mode-for-asciidoctorj
executionMode = ExecutionMode.JAVA_EXEC

Expand Down
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ org.gradle.parallel=true
# enable Gradle's Task Cache. worst case:
# > rm -rf ~/.gradle/caches/build-cache-1
org.gradle.caching=true
org.gradle.configuration-cache=true
org.gradle.configureondemand=true

# JDK auto-detection is not quite ready yet in Gradle 6.7.
# On Fedora in particular, if you have the package java-1.8.0-openjdk-headless-1.8.0.265.b01-1.fc32.x86_64 installed,
Expand Down
4 changes: 4 additions & 0 deletions hibernate-core/hibernate-core.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -295,3 +295,7 @@ tasks.sourcesJar.dependsOn ':hibernate-core:generateGraphParser'
tasks.sourcesJar.dependsOn ':hibernate-core:generateHqlParser'
tasks.sourcesJar.dependsOn ':hibernate-core:generateSqlScriptParser'
tasks.sourcesJar.dependsOn ':hibernate-core:generateOrderingParser'

tasks.named( "compileJava", JavaCompile ) {
notCompatibleWithConfigurationCache( "org.hibernate.build.version-injection plugin call project in execution time" )
}
24 changes: 8 additions & 16 deletions local-build-plugins/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,43 +49,35 @@ tasks.compileJava {

gradlePlugin {
plugins {
databaseServicePlugin {
register( "databaseServicePlugin" ) {
id = 'org.hibernate.orm.database-service'
implementationClass = 'org.hibernate.orm.db.DatabaseServicePlugin'
}
antlrPlugin {
register( "antlrPlugin" ) {
id = 'org.hibernate.orm.antlr'
implementationClass = 'org.hibernate.orm.antlr.AntlrPlugin'
}
jakartaPlugin {
id = 'org.hibernate.orm.jakarta'
implementationClass = 'org.hibernate.orm.jakarta.JakartaPlugin'
}
jakartaPublishPlugin {
id = 'org.hibernate.orm.jakarta-publish'
implementationClass = 'org.hibernate.orm.jakarta.JakartaPublishingPlugin'
}
reportsPlugin {
register( "reportsPlugin" ) {
id = 'org.hibernate.orm.build.reports'
implementationClass = 'org.hibernate.orm.post.ReportGenerationPlugin'
}
envSettings {
register( "envSettings" ) {
id = 'org.hibernate.orm.build.env-settings'
implementationClass = 'org.hibernate.orm.env.EnvironmentSettingsPlugin'
}
jdkVersionSettings {
register( "jdkVersionSettings" ) {
id = 'org.hibernate.orm.build.jdks-settings'
implementationClass = 'org.hibernate.orm.toolchains.JdkVersionSettingsPlugin'
}
settingsDocumentationPlugin {
register( "settingsDocumentationPlugin" ) {
id = 'org.hibernate.orm.build.settings-doc'
implementationClass = 'org.hibernate.orm.properties.SettingsDocumentationPlugin'
}
jdkVersionsPlugin {
register( "jdkVersionsPlugin" ) {
id = 'org.hibernate.orm.build.jdks'
implementationClass = 'org.hibernate.orm.toolchains.JdkVersionPlugin'
}
javaModulePlugin {
register( "javaModulePlugin" ) {
id = 'org.hibernate.orm.build.java-module'
implementationClass = 'org.hibernate.orm.toolchains.JavaModulePlugin'
}
Expand Down
5 changes: 4 additions & 1 deletion local-build-plugins/src/main/groovy/local.java-module.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,10 @@ tasks.withType(Jar).configureEach {
}
}

tasks.named("jar") {
tasks.named( "jar", Jar ) {
// Remove when https://github.com/bndtools/bnd/issues/6346 is fixed
notCompatibleWithConfigurationCache( "Bnd plugin access to project at execution time" )

manifest {
attributes(
// Java 9 module name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

import org.gradle.api.Project;
import org.gradle.api.provider.Provider;
import org.gradle.api.tasks.Input;
import org.gradle.api.tasks.InputFile;
import org.gradle.api.tasks.Internal;
import org.gradle.api.tasks.Nested;

import javax.inject.Inject;
import java.io.File;
Expand Down Expand Up @@ -39,43 +43,53 @@ public OrmBuildDetails(Project project) {
databaseName = (String) project.property( "db" );
}

@InputFile
public Provider<File> getVersionFileAccess() {
return versionFileAccess;
}

public HibernateVersion getHibernateVersion() {
return hibernateVersion;
@Nested
public ReleaseDetails getReleaseDetails() {
return releaseDetails;
}

@Input
public String getHibernateVersionName() {
return getHibernateVersion().getFullName();
}

@Input
public String getHibernateVersionFamily() {
return getHibernateVersion().getFamily();
}

@Input
public String getHibernateVersionNameOsgi() {
return getHibernateVersion().getOsgiVersion();
}

public ReleaseDetails getReleaseDetails() {
return releaseDetails;
}

public JpaVersion getJpaVersion() {
return jpaVersion;
}

@Input
public String getJpaVersionName() {
return getJpaVersion().getName();
}

@Input
public String getJpaVersionNameOsgi() {
return getJpaVersion().getOsgiName();
}

@Input
public String getDatabaseName() {
return databaseName;
}

@Internal
public HibernateVersion getHibernateVersion() {
return hibernateVersion;
}

@Internal
public JpaVersion getJpaVersion() {
return jpaVersion;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

import org.gradle.api.Project;
import org.gradle.api.provider.Provider;
import org.gradle.api.tasks.Input;
import org.gradle.api.tasks.Internal;
import org.gradle.api.tasks.Optional;

/**
* @author Steve Ebersole
Expand Down Expand Up @@ -36,14 +39,17 @@ public ReleaseDetails(Project project) {
createTagAccess = project.provider( () -> !project.hasProperty( "noTag" ) );
}

@Internal
public HibernateVersion getReleaseVersion() {
return releaseVersion;
}

@Internal
public HibernateVersion getDevelopmentVersion() {
return developmentVersion;
}

@Input
public Provider<Boolean> getCreateTagAccess() {
return createTagAccess;
}
Expand All @@ -52,10 +58,13 @@ public boolean shouldCreateTag() {
return getCreateTagAccess().get();
}

@Input
@Optional
public Provider<String> getTagNameAccess() {
return tagNameAccess;
}

@Internal
public String getTagNameToUse() {
return getTagNameAccess().get();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
package org.hibernate.build.xjc;

import com.sun.tools.xjc.XJCListener;
import org.gradle.api.Project;
import org.gradle.api.logging.Logger;
import org.xml.sax.SAXParseException;

/**
Expand All @@ -15,12 +15,12 @@
*/
public class XjcListenerImpl extends XJCListener {
private final String schemaName;
private final Project project;
private final Logger logger;
private boolean hadErrors;

public XjcListenerImpl(String schemaName, Project project) {
public XjcListenerImpl(String schemaName, Logger logger) {
this.schemaName = schemaName;
this.project = project;
this.logger = logger;
}

public boolean hadErrors() {
Expand All @@ -29,33 +29,33 @@ public boolean hadErrors() {

@Override
public void generatedFile(String fileName, int current, int total) {
project.getLogger().info( "XJC generated file ({}) : {}", schemaName, fileName );
logger.info( "XJC generated file ({}) : {}", schemaName, fileName );
}

@Override
public void message(String msg) {
project.getLogger().info( "XJC message ({}) : {}", schemaName, msg );
logger.info( "XJC message ({}) : {}", schemaName, msg );
}

@Override
public void info(SAXParseException exception) {
project.getLogger().info( "XJC info ({})", schemaName, exception );
logger.info( "XJC info ({})", schemaName, exception );
}

@Override
public void warning(SAXParseException exception) {
project.getLogger().warn( "XJC warning ({})",schemaName, exception );
logger.warn( "XJC warning ({})",schemaName, exception );
}

@Override
public void error(SAXParseException exception) {
hadErrors = true;
project.getLogger().error( "XJC error ({})", schemaName, exception );
logger.error( "XJC error ({})", schemaName, exception );
}

@Override
public void fatalError(SAXParseException exception) {
hadErrors = true;
project.getLogger().error( "XJC fatal error ({})", schemaName, exception );
logger.error( "XJC fatal error ({})", schemaName, exception );
}
}
Loading