HHH-8156 - Apply new Gradle plugins

This commit is contained in:
Steve Ebersole 2013-04-08 14:27:47 -05:00
parent e019c2ac19
commit 826aa6301f
2 changed files with 170 additions and 22 deletions

View File

@ -72,8 +72,14 @@ subprojects { subProject ->
apply plugin: 'maven' // for install task as well as deploy dependencies apply plugin: 'maven' // for install task as well as deploy dependencies
apply plugin: 'uploadAuth' apply plugin: 'uploadAuth'
apply plugin: 'osgi' apply plugin: 'osgi'
apply from: "../utilities.gradle" apply from: "../utilities.gradle"
apply plugin: 'findbugs'
apply plugin: 'checkstyle'
apply plugin: 'build-dashboard'
apply plugin: 'project-report'
configurations { configurations {
provided { provided {
// todo : need to make sure these are non-exported // todo : need to make sure these are non-exported
@ -194,33 +200,33 @@ subprojects { subProject ->
jar { jar {
Set<String> exportPackages = new HashSet<String>() Set<String> exportPackages = new HashSet<String>()
Set<String> privatePackages = new HashSet<String>() Set<String> privatePackages = new HashSet<String>()
// TODO: Could more of this be pulled into utilities.gradle? // TODO: Could more of this be pulled into utilities.gradle?
sourceSets.each { sourceSet -> sourceSets.each { sourceSet ->
// skip certain source sets // skip certain source sets
if ( ! ['test','matrix'].contains( sourceSet.name ) ) { if ( ! ['test','matrix'].contains( sourceSet.name ) ) {
sourceSet.java.each { javaFile -> sourceSet.java.each { javaFile ->
// - org.hibernate.boot.registry.classloading.internal // - org.hibernate.boot.registry.classloading.internal
// until EntityManagerFactoryBuilderImpl no longer imports ClassLoaderServiceImpl // until EntityManagerFactoryBuilderImpl no longer imports ClassLoaderServiceImpl
// - .util for external module use (especially envers) // - .util for external module use (especially envers)
final String[] temporaryExports = [ final String[] temporaryExports = [
'org.hibernate.boot.registry.classloading.internal', 'org.hibernate.boot.registry.classloading.internal',
'org.hibernate.internal.util' ] 'org.hibernate.internal.util' ]
final String packageName = determinePackageName( sourceSet.java, javaFile ); final String packageName = determinePackageName( sourceSet.java, javaFile );
if ( ! temporaryExports.contains( packageName ) if ( ! temporaryExports.contains( packageName )
&& ( packageName.endsWith( ".internal" ) && ( packageName.endsWith( ".internal" )
|| packageName.contains( ".internal." ) || packageName.contains( ".internal." )
|| packageName.endsWith( ".test" ) || packageName.endsWith( ".test" )
|| packageName.contains( ".test." ) ) ) { || packageName.contains( ".test." ) ) ) {
privatePackages.add( packageName ); privatePackages.add( packageName );
} }
else { else {
exportPackages.add( packageName ); exportPackages.add( packageName );
}
}
} }
} }
}
}
manifest = osgiManifest { manifest = osgiManifest {
// GRADLE-1411: Even if we override Imports and Exports // GRADLE-1411: Even if we override Imports and Exports
@ -294,6 +300,19 @@ subprojects { subProject ->
} }
} }
// Report configs ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
checkstyle {
configFile = rootProject.file( 'shared/config/checkstyle/checkstyle.xml' )
showViolations = false
ignoreFailures = true
}
findbugs {
ignoreFailures = true
}
buildDashboard.dependsOn check
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// elements used to customize the generated POM used during upload // elements used to customize the generated POM used during upload
def pomConfig = { def pomConfig = {
name 'A Hibernate O/RM Module' name 'A Hibernate O/RM Module'

View File

@ -0,0 +1,129 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Hibernate, Relational Persistence for Idiomatic Java
~
~ Copyright (c) 2013, Red Hat Inc. or third-party contributors as
~ indicated by the @author tags or express copyright attribution
~ statements applied by the authors. All third-party contributions are
~ distributed under license by Red Hat Inc.
~
~ This copyrighted material is made available to anyone wishing to use, modify,
~ copy, or redistribute it subject to the terms and conditions of the GNU
~ Lesser General Public License, as published by the Free Software Foundation.
~
~ This program is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
~ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
~ for more details.
~
~ You should have received a copy of the GNU Lesser General Public License
~ along with this distribution; if not, write to:
~ Free Software Foundation, Inc.
~ 51 Franklin Street, Fifth Floor
~ Boston, MA 02110-1301 USA
-->
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.1//EN" "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
<module name="Checker">
<module name="TreeWalker">
<!-- Annotation checks : http://checkstyle.sourceforge.net/config_annotation.html -->
<module name="MissingDeprecated" />
<module name="MissingOverride" />
<module name="PackageAnnotation" />
<!-- Block checks : http://checkstyle.sourceforge.net/config_blocks.html -->
<module name="AvoidNestedBlocks">
<property name="allowInSwitchCase" value="true" />
<property name="severity" value="warning" />
</module>
<module name="NeedBraces" />
<!-- Design checks : http://checkstyle.sourceforge.net/config_design.html -->
<module name="HideUtilityClassConstructor" />
<module name="MutableException" />
<!-- Coding checks : http://checkstyle.sourceforge.net/config_coding.html -->
<module name="EmptyStatement" />
<module name="EqualsHashCode" />
<module name="FinalLocalVariable" />
<module name="MissingSwitchDefault" />
<module name="ModifiedControlVariable" />
<module name="SimplifyBooleanExpression" />
<module name="SimplifyBooleanReturn" />
<module name="StringLiteralEquality" />
<module name="NoFinalizer" />
<module name="ExplicitInitialization" />
<module name="MissingSwitchDefault" />
<module name="DefaultComesLast" />
<module name="FallThrough" />
<!--
<module name="RequireThis" />
-->
<module name="OneStatementPerLine" />
<!-- Import checks : http://checkstyle.sourceforge.net/config_imports.html -->
<module name="AvoidStarImport" />
<module name="RedundantImport" />
<module name="UnusedImports" />
<!-- Javadoc checks : http://checkstyle.sourceforge.net/config_javadoc.html -->
<module name="JavadocType">
<property name="scope" value="public"/>
<property name="allowUnknownTags" value="true" />
</module>
<module name="JavadocMethod">
<property name="scope" value="public" />
<property name="allowUndeclaredRTE" value="true" />
<property name="allowMissingPropertyJavadoc" value="true" />
</module>
<module name="JavadocVariable">
<property name="scope" value="public" />
</module>
<module name="JavadocStyle">
<property name="scope" value="public" />
</module>
<!-- Metric checks : http://checkstyle.sourceforge.net/config_metrics.html -->
<module name="BooleanExpressionComplexity" />
<!-- Misc checks : http://checkstyle.sourceforge.net/config_misc.html-->
<module name="TodoComment">
<property name="format" value="TODO|todo" />
</module>
<module name="UpperEll" />
<module name="ArrayTypeStyle" />
<!--
<module name="FinalParameters" />
<module name="TrailingComment" />
-->
<!-- Modifier checks : http://checkstyle.sourceforge.net/config_modifier.html -->
<module name="ModifierOrder"/>
<!-- Naming checks : http://checkstyle.sourceforge.net/config_naming.html -->
<module name="AbstractClassName" />
<module name="ClassTypeParameterName" />
<module name="ConstantName">
<property name="format" value="^[A-Z](_?[A-Z0-9]+)*$|log" />
</module>
<module name="LocalFinalVariableName" />
<module name="LocalVariableName" />
<module name="MemberName" />
<module name="MethodName" />
<module name="MethodTypeParameterName" />
<module name="PackageName" />
<module name="ParameterName" />
<module name="StaticVariableName" />
<module name="TypeName" />
<!-- Whitespace checks : http://checkstyle.sourceforge.net/config_whitespace.html -->
<module name="MethodParamPad" />
<module name="TypecastParenPad" />
</module>
<!-- Misc checks : http://checkstyle.sourceforge.net/config_misc.html-->
<module name="NewlineAtEndOfFile" />
</module>