HHH-9161 - Improve build handling of generated sources
This commit is contained in:
parent
5bb9d2e2d1
commit
f237a9d24f
|
@ -148,8 +148,6 @@ subprojects { subProject ->
|
||||||
testRuntime( libraries.javassist )
|
testRuntime( libraries.javassist )
|
||||||
testRuntime( libraries.h2 )
|
testRuntime( libraries.h2 )
|
||||||
|
|
||||||
jbossLoggingTool( libraries.logging_processor )
|
|
||||||
|
|
||||||
jaxb( libraries.jaxb ){
|
jaxb( libraries.jaxb ){
|
||||||
exclude group: "javax.xml.stream"
|
exclude group: "javax.xml.stream"
|
||||||
}
|
}
|
||||||
|
@ -185,15 +183,12 @@ subprojects { subProject ->
|
||||||
tasks.withType( JavaCompile.class ).all { task->
|
tasks.withType( JavaCompile.class ).all { task->
|
||||||
task.options.compilerArgs += [
|
task.options.compilerArgs += [
|
||||||
"-nowarn",
|
"-nowarn",
|
||||||
"-proc:none",
|
|
||||||
"-encoding", "UTF-8",
|
"-encoding", "UTF-8",
|
||||||
"-source", rootProject.javaLanguageLevel,
|
"-source", rootProject.javaLanguageLevel,
|
||||||
"-target", rootProject.javaLanguageLevel
|
"-target", rootProject.javaLanguageLevel
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
addLoggingProcessor( sourceSets.main )
|
|
||||||
|
|
||||||
jar {
|
jar {
|
||||||
manifest = osgiManifest {
|
manifest = osgiManifest {
|
||||||
// GRADLE-1411: Even if we override Imports and Exports
|
// GRADLE-1411: Even if we override Imports and Exports
|
||||||
|
|
|
@ -74,9 +74,6 @@ class SourceGenerationPlugin implements Plugin<Project> {
|
||||||
}
|
}
|
||||||
|
|
||||||
class SourceGenerationPluginConvention {
|
class SourceGenerationPluginConvention {
|
||||||
public static final String LOGGING_DEPENDENCY_CONFIG_NAME = "jbossLoggingTool";
|
|
||||||
public static final String LOGGING_PROCESSOR_NAME = "org.jboss.logging.processor.apt.LoggingToolsProcessor";
|
|
||||||
|
|
||||||
public static final String METAGEN_DEPENDENCY_CONFIG_NAME = "hibernateJpaModelGenTool";
|
public static final String METAGEN_DEPENDENCY_CONFIG_NAME = "hibernateJpaModelGenTool";
|
||||||
public static final String METAGEN_PROCESSOR_NAME = "org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor";
|
public static final String METAGEN_PROCESSOR_NAME = "org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor";
|
||||||
|
|
||||||
|
@ -90,12 +87,6 @@ class SourceGenerationPluginConvention {
|
||||||
this.project = project
|
this.project = project
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addLoggingProcessor(SourceSet sourceSet) {
|
|
||||||
AnnotationProcessorOnlyTask task = getLocateProcessorOnlyTask( sourceSet )
|
|
||||||
task.processors += LOGGING_PROCESSOR_NAME
|
|
||||||
task.classpath += project.configurations[LOGGING_DEPENDENCY_CONFIG_NAME];
|
|
||||||
}
|
|
||||||
|
|
||||||
private AnnotationProcessorOnlyTask getLocateProcessorOnlyTask(SourceSet sourceSet) {
|
private AnnotationProcessorOnlyTask getLocateProcessorOnlyTask(SourceSet sourceSet) {
|
||||||
if ( sourceSet.name.equals( "main" ) ) {
|
if ( sourceSet.name.equals( "main" ) ) {
|
||||||
if ( mainProcOnlyTask == null ) {
|
if ( mainProcOnlyTask == null ) {
|
||||||
|
|
Loading…
Reference in New Issue