[hibernate-commits] Hibernate SVN: r19705 - in core/branches/gradle2: buildSrc and 8 other directories.

hibernate-commits at lists.jboss.org hibernate-commits at lists.jboss.org
Thu Jun 10 01:06:54 EDT 2010


Author: steve.ebersole at jboss.com
Date: 2010-06-10 01:06:54 -0400 (Thu, 10 Jun 2010)
New Revision: 19705

Added:
   core/branches/gradle2/buildSrc/
   core/branches/gradle2/buildSrc/build.gradle
   core/branches/gradle2/buildSrc/src/
   core/branches/gradle2/buildSrc/src/main/
   core/branches/gradle2/buildSrc/src/main/groovy/
   core/branches/gradle2/buildSrc/src/main/groovy/org/
   core/branches/gradle2/buildSrc/src/main/groovy/org/hibernate/
   core/branches/gradle2/buildSrc/src/main/groovy/org/hibernate/gradle/
   core/branches/gradle2/buildSrc/src/main/groovy/org/hibernate/gradle/javadoc/
   core/branches/gradle2/buildSrc/src/main/groovy/org/hibernate/gradle/javadoc/Aggregator.groovy
   core/branches/gradle2/buildSrc/src/main/groovy/org/hibernate/gradle/javadoc/Javadoc.groovy
Modified:
   core/branches/gradle2/build.gradle
   core/branches/gradle2/hibernate-release/hibernate-release.gradle
Log:
mostly fleshed out release tasks

Modified: core/branches/gradle2/build.gradle
===================================================================
--- core/branches/gradle2/build.gradle	2010-06-09 13:36:38 UTC (rev 19704)
+++ core/branches/gradle2/build.gradle	2010-06-10 05:06:54 UTC (rev 19705)
@@ -15,13 +15,12 @@
     javaVersion = "1.5"
 }
 
-subprojects {
-    apply plugin: 'java'
-
+subprojects { subProject ->
     group = 'org.hibernate.gradlePoC'
     version = '1.0.0-SNAPSHOT'
 
-    defaultTasks 'classes'
+    // minimize changes, at least for now (gradle uses 'build' by default)..
+    buildDirName = "target"
 
     repositories {
         mavenCentral()
@@ -30,79 +29,84 @@
         mavenRepo urls: "file://" + System.getProperty('user.home') + "/.m2/repository/"
     }
 
-    configurations {
-        provided {
-            // todo : need to make sure these are non-exported
-            description = 'Non-exported compile-time dependencies.'
-        }
+    if ( 'hibernate-release' == subProject.name ) {
+        apply plugin : 'base'
     }
+    else {
+        apply plugin: 'java'
+        defaultTasks 'classes'
 
-    ideaModule {
-        downloadJavadoc = false
-        scopes.COMPILE.plus.add(configurations.provided)
-    }
+        configurations {
+            provided {
+                // todo : need to make sure these are non-exported
+                description = 'Non-exported compile-time dependencies.'
+            }
+        }
 
-    dependencies {
-        slf4jVersion = '1.5.8'
-        dom4jVersion = '1.6.1'
-        antlrVersion = '2.7.7'
-        annotationsCommonsVersion = '3.2.0.Final'
-        jpaVersion = '1.0.0.Final'
-        jtaVersion = '1.1'
-        javassistVersion = '3.12.0.GA'
-        cglibVersion = '2.2'
-        javaxValidationVersion = '1.0.0.GA'
-        hibernateValidatorVersion = '4.0.2.GA'
+        dependencies {
+            slf4jVersion = '1.5.8'
+            dom4jVersion = '1.6.1'
+            antlrVersion = '2.7.7'
+            annotationsCommonsVersion = '3.2.0.Final'
+            jpaVersion = '1.0.0.Final'
+            jtaVersion = '1.1'
+            javassistVersion = '3.12.0.GA'
+            cglibVersion = '2.2'
+            javaxValidationVersion = '1.0.0.GA'
+            hibernateValidatorVersion = '4.0.2.GA'
 
-        junitVersion = '3.8.2'
-        testngVersion = '5.8'
+            junitVersion = '3.8.2'
+            testngVersion = '5.8'
 
-        h2Version = '1.2.134'
+            h2Version = '1.2.134'
 
-        compile(
-                group: 'org.slf4j', name: 'slf4j-api', version: slf4jVersion
-        )
-        testCompile(
-                [group: 'junit', name: 'junit', version: junitVersion]
-        )
-        testRuntime(
-                [group: 'org.slf4j', name: 'jcl-over-slf4j', version: slf4jVersion],
-                [group: 'org.slf4j', name: 'slf4j-log4j12', version: slf4jVersion],
-                [group: 'com.h2database', name: 'h2', version: h2Version]
-        )
-    }
+            compile(
+                    group: 'org.slf4j', name: 'slf4j-api', version: slf4jVersion
+            )
+            testCompile(
+                    [group: 'junit', name: 'junit', version: junitVersion]
+            )
+            testRuntime(
+                    [group: 'org.slf4j', name: 'jcl-over-slf4j', version: slf4jVersion],
+                    [group: 'org.slf4j', name: 'slf4j-log4j12', version: slf4jVersion],
+                    [group: 'com.h2database', name: 'h2', version: h2Version]
+            )
+        }
 
-    sourceSets {
-        main {
-            compileClasspath = compileClasspath + configurations.provided
+        sourceSets {
+            main {
+                compileClasspath = compileClasspath + configurations.provided
+            }
         }
-    }
 
-    manifest.mainAttributes(
-            provider: 'gradle',
-            'Implementation-Url': 'http://hibernate.org',
-            'Implementation-Version': version,
-            'Implementation-Vendor': 'Hibernate.org',
-            'Implementation-Vendor-Id': 'org.hibernate'
-    )
+        manifest.mainAttributes(
+                provider: 'gradle',
+                'Implementation-Url': 'http://hibernate.org',
+                'Implementation-Version': version,
+                'Implementation-Vendor': 'Hibernate.org',
+                'Implementation-Vendor-Id': 'org.hibernate'
+        )
 
-    // minimize changes, at least for now..
-    buildDirName = "target"
+        compileJava {
+            if (hasProperty('jdk15_home')) { options.fork(executable: "$jdk15_home/bin/javac") }
+        }
 
-    // by default, compile to 1.5 compatibility
-    targetCompatibility = "1.5"
-    sourceCompatibility = "1.5"
+        compileTestJava {
+            if (hasProperty('jdk15_home')) { options.fork(executable: "$jdk15_home/bin/javac") }
+        }
 
-    compileJava {
-        if (hasProperty('jdk15_home')) { options.fork(executable: "$jdk15_home/bin/javac") }
-    }
+        test {
+            ignoreFailures = true
+        }
 
-    compileTestJava {
-        if (hasProperty('jdk15_home')) { options.fork(executable: "$jdk15_home/bin/javac") }
-    }
+        // by default, compile to 1.5 compatibility
+        targetCompatibility = "1.5"
+        sourceCompatibility = "1.5"
 
-    test {
-        ignoreFailures = true
+        ideaModule {
+            downloadJavadoc = false
+            scopes.COMPILE.plus.add(configurations.provided)
+        }
     }
 }
 


Property changes on: core/branches/gradle2/buildSrc
___________________________________________________________________
Name: svn:ignore
   + target
build
local
*.ipr
*.iws
*.iml
.classpath
.project
.nbattrs
*.log
*.properties
.clover
.*


Added: core/branches/gradle2/buildSrc/build.gradle
===================================================================
--- core/branches/gradle2/buildSrc/build.gradle	                        (rev 0)
+++ core/branches/gradle2/buildSrc/build.gradle	2010-06-10 05:06:54 UTC (rev 19705)
@@ -0,0 +1,18 @@
+buildscript {
+    repositories {
+        mavenRepo urls: 'http://gradle.artifactoryonline.com/gradle/plugins'
+    }
+    dependencies {
+        classpath "org.gradle.plugins:gradle-idea-plugin:0.3"
+    }
+}
+
+apply plugin: 'groovy'
+
+dependencies {
+    compile gradleApi()
+    compile localGroovy()
+    compile 'org.apache.ant:ant:1.7.0'
+
+    groovy localGroovy()
+}
\ No newline at end of file

Added: core/branches/gradle2/buildSrc/src/main/groovy/org/hibernate/gradle/javadoc/Aggregator.groovy
===================================================================
--- core/branches/gradle2/buildSrc/src/main/groovy/org/hibernate/gradle/javadoc/Aggregator.groovy	                        (rev 0)
+++ core/branches/gradle2/buildSrc/src/main/groovy/org/hibernate/gradle/javadoc/Aggregator.groovy	2010-06-10 05:06:54 UTC (rev 19705)
@@ -0,0 +1,70 @@
+package org.hibernate.gradle.javadoc
+
+import org.gradle.api.Project
+import org.gradle.api.tasks.SourceSet
+
+/**
+ * TODO : javadoc
+ *
+ * @author Steve Ebersole
+ */
+class Aggregator {
+	private final Javadoc javadocTask;
+	private Set<String> excludedSourceSetNames;
+
+	public Aggregator(Javadoc javadocTask) {
+		this.javadocTask = javadocTask;
+	}
+
+	private Set<String> getExcludedSourceSetNames() {
+		if ( excludedSourceSetNames == null ) {
+			excludedSourceSetNames = new HashSet<String>();
+		}
+		return excludedSourceSetNames;
+	}
+
+	/**
+	 * Allow adding them one by one
+	 *
+	 */
+	public void excludeSourceSetName(String name) {
+		getExcludedSourceSetNames().add( name );
+	}
+
+	/**
+	 * Also, allow adding them all at once
+	 */
+	public void excludeSourceSetNames(String[] names) {
+		getExcludedSourceSetNames().addAll( Arrays.asList( names ) );
+	}
+
+	public void project(Project project) {
+		project.sourceSets.each { SourceSet sourceSet ->
+            if ( excludedSourceSetNames == null || !excludedSourceSetNames.contains( sourceSet.name ) ) {
+                javadocTask.source sourceSet.allJava
+                if( javadocTask.classpath ) {
+                    javadocTask.classpath += sourceSet.classes + sourceSet.compileClasspath
+                }
+                else {
+                    javadocTask.classpath = sourceSet.classes + sourceSet.compileClasspath
+                }
+            }
+        }
+//        project.sourceSets.each { SourceSet sourceSet ->
+//            // we skip test sources.  Would rather this be configurable, like I'd see a syntax like:
+//            // task javadoc(type: Javadoc) {
+//            //     ...
+//            //     aggregator {
+//            //         skipSourceSet 'test'
+//            //     }
+//            // }
+//            if ( !SourceSet.TEST_SOURCE_SET_NAME.equals(sourceSet.getName()) ) {
+//                source(sourceSet.allJava);
+//                (sourceSet.classes + sourceSet.compileClasspath).each { File classPathElement ->
+//                    getJavadocOptions().classpath(classPathElement);
+//                }
+//            }
+//        }
+
+	}
+}

Added: core/branches/gradle2/buildSrc/src/main/groovy/org/hibernate/gradle/javadoc/Javadoc.groovy
===================================================================
--- core/branches/gradle2/buildSrc/src/main/groovy/org/hibernate/gradle/javadoc/Javadoc.groovy	                        (rev 0)
+++ core/branches/gradle2/buildSrc/src/main/groovy/org/hibernate/gradle/javadoc/Javadoc.groovy	2010-06-10 05:06:54 UTC (rev 19705)
@@ -0,0 +1,234 @@
+package org.hibernate.gradle.javadoc
+
+import org.gradle.external.javadoc.JavadocMemberLevel
+import org.gradle.external.javadoc.StandardJavadocDocletOptions
+import org.gradle.external.javadoc.JavadocOutputLevel
+import org.gradle.process.ExecSpec
+import org.gradle.api.tasks.TaskAction
+import org.gradle.process.internal.ExecAction
+import org.gradle.process.internal.ExecException
+import org.gradle.api.GradleException
+import org.gradle.util.GUtil
+import org.gradle.api.Project
+import org.gradle.api.tasks.SourceSet
+import org.gradle.api.tasks.SourceTask
+import org.gradle.external.javadoc.MinimalJavadocOptions
+import org.gradle.api.file.FileCollection
+import org.gradle.api.tasks.InputFiles
+import org.gradle.external.javadoc.JavadocExecHandleBuilder
+import org.gradle.api.tasks.OutputDirectory
+import org.gradle.util.ConfigureUtil
+
+/**
+ * TODO : javadoc
+ *
+ * @author Steve Ebersole
+ */
+class Javadoc extends SourceTask {
+    private JavadocExecHandleBuilder javadocExecHandleBuilder = new JavadocExecHandleBuilder();
+
+    private File destinationDir;
+
+    private boolean failOnError = true;
+
+    private String title;
+
+    private String maxMemory;
+
+    private MinimalJavadocOptions options = new StandardJavadocDocletOptions();
+
+// EmptyFileCollection not available in my project as is
+//    private FileCollection classpath = new EmptyFileCollection();
+    private FileCollection classpath;
+
+    private String executable;
+
+    @TaskAction
+    protected void generate() {
+        final File destinationDir = getDestinationDir();
+
+        if (options.getDestinationDirectory() == null) {
+            options.destinationDirectory(destinationDir);
+        }
+
+        options.classpath(new ArrayList<File>(getClasspath().getFiles()));
+
+        if (!GUtil.isTrue(options.getWindowTitle()) && GUtil.isTrue(getTitle())) {
+            options.windowTitle(getTitle());
+        }
+        if (options instanceof StandardJavadocDocletOptions) {
+            StandardJavadocDocletOptions docletOptions = (StandardJavadocDocletOptions) options;
+            if (!GUtil.isTrue(docletOptions.getDocTitle()) && GUtil.isTrue(getTitle())) {
+                docletOptions.setDocTitle(getTitle());
+            }
+        }
+
+        if (maxMemory != null) {
+            final List<String> jFlags = options.getJFlags();
+            final Iterator<String> jFlagsIt = jFlags.iterator();
+            boolean containsXmx = false;
+            while (!containsXmx && jFlagsIt.hasNext()) {
+                final String jFlag = jFlagsIt.next();
+                if (jFlag.startsWith("-Xmx")) {
+                    containsXmx = true;
+                }
+            }
+            if (!containsXmx) {
+                options.jFlags("-Xmx" + maxMemory);
+            }
+        }
+
+        List<String> sourceNames = new ArrayList<String>();
+        for (File sourceFile : getSource()) {
+            sourceNames.add(sourceFile.getAbsolutePath());
+        }
+        options.setSourceNames(sourceNames);
+
+        executeExternalJavadoc();
+    }
+
+    private void executeExternalJavadoc() {
+        javadocExecHandleBuilder.execDirectory( getProject().getRootDir() )
+                .options( options )
+                .optionsFile( getOptionsFile() );
+
+        ExecAction execAction = javadocExecHandleBuilder.getExecHandle();
+        if (  executable != null && executable.length() > 0 ) {
+            execAction.setExecutable( executable );
+        }
+
+        if (!failOnError) {
+            execAction.setIgnoreExitValue(true);
+        }
+
+        try {
+            execAction.execute();
+        } catch (ExecException e) {
+            throw new GradleException("Javadoc generation failed.", e);
+        }
+    }
+
+    void setJavadocExecHandleBuilder(JavadocExecHandleBuilder javadocExecHandleBuilder) {
+        if (javadocExecHandleBuilder == null) {
+            throw new IllegalArgumentException("javadocExecHandleBuilder == null!");
+        }
+        this.javadocExecHandleBuilder = javadocExecHandleBuilder;
+    }
+
+    /**
+* <p>Returns the directory to generate the documentation into.</p>
+*
+* @return The directory.
+*/
+    @OutputDirectory
+    public File getDestinationDir() {
+        return destinationDir;
+    }
+
+    /**
+* <p>Sets the directory to generate the documentation into.</p>
+*/
+    public void setDestinationDir(File destinationDir) {
+        this.destinationDir = destinationDir;
+    }
+
+    /**
+* Returns the amount of memory allocated to this task.
+*/
+    public String getMaxMemory() {
+        return maxMemory;
+    }
+
+    /**
+* Sets the amount of memory allocated to this task.
+*
+* @param maxMemory The amount of memory
+*/
+    public void setMaxMemory(String maxMemory) {
+        this.maxMemory = maxMemory;
+    }
+
+    /**
+* <p>Returns the title for the generated documentation.</p>
+*
+* @return The title, possibly null.
+*/
+    public String getTitle() {
+        return title;
+    }
+
+    /**
+* <p>Sets the title for the generated documentation.</p>
+*/
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    /**
+* Returns whether javadoc generation is accompanied by verbose output.
+*
+* @see #setVerbose(boolean)
+*/
+    public boolean isVerbose() {
+        return options.isVerbose();
+    }
+
+    /**
+* Sets whether javadoc generation is accompanied by verbose output or not. The verbose output is done via println
+* (by the underlying ant task). Thus it is not catched by our logging.
+*
+* @param verbose Whether the output should be verbose.
+*/
+    public void setVerbose(boolean verbose) {
+        if (verbose) {
+            options.verbose();
+        }
+    }
+
+    @InputFiles
+    public FileCollection getClasspath() {
+        return classpath;
+    }
+
+    public void setClasspath(FileCollection configuration) {
+        this.classpath = configuration;
+    }
+
+    public MinimalJavadocOptions getOptions() {
+        return options;
+    }
+
+    public void setOptions(MinimalJavadocOptions options) {
+        this.options = options;
+    }
+
+    public boolean isFailOnError() {
+        return failOnError;
+    }
+
+    public void setFailOnError(boolean failOnError) {
+        this.failOnError = failOnError;
+    }
+
+    public File getOptionsFile() {
+        return new File(getTemporaryDir(), "javadoc.options");
+    }
+
+    public String getExecutable() {
+        return executable;
+    }
+
+    public void setExecutable(String executable) {
+        this.executable = executable;
+    }
+
+    private Aggregator aggregator;
+
+    public void aggregator(Closure closure) {
+        if ( aggregator == null ) {
+            aggregator = new Aggregator( this );
+        }
+		ConfigureUtil.configure( closure, aggregator );
+    }
+
+}

Modified: core/branches/gradle2/hibernate-release/hibernate-release.gradle
===================================================================
--- core/branches/gradle2/hibernate-release/hibernate-release.gradle	2010-06-09 13:36:38 UTC (rev 19704)
+++ core/branches/gradle2/hibernate-release/hibernate-release.gradle	2010-06-10 05:06:54 UTC (rev 19705)
@@ -55,19 +55,21 @@
 
 javadocBuildDir = dir( buildDirName +  "/javadocs" )
 
-def List subProjectsToSkipForJavadoc = ["testsuite"];
+def List subProjectsToSkipForJavadoc = ["testsuite", 'hibernate-release'];
 
-task aggregateJavadocs(type: Javadoc) {
-//    executable: '${jdk16_home}/bin/javadoc'
-    maxmemory = '512m'
+task aggregateJavadocs(type: org.hibernate.gradle.javadoc.Javadoc) {
+    description = "Build the aggregated JavaDocs for all modules"
+    executable = "$jdk16_home/bin/javadoc"
+    maxMemory = '512m'
     destinationDir = javadocBuildDir.dir
     configure( options ) {
         overview = new File( projectDir, 'src/javadoc/package.html' )
-        stylesheetfile = new File( projectDir, 'src/javadoc/stylesheet.css' )
-        windowtitle = 'Hibernate JavaDocs'
-        doctitle = "Hibernate JavaDoc ($version)"
+        stylesheetFile = new File( projectDir, 'src/javadoc/stylesheet.css' )
+        windowTitle = 'Hibernate JavaDocs'
+        docTitle = "Hibernate JavaDoc ($project.version)"
         bottom = 'Copyright &copy; 2001-2010 <a href="http://redhat.com">Red Hat, Inc.</a>  All Rights Reserved.'
         use = true
+        links = [ 'http://java.sun.com/j2se/1.5.0/docs/api', 'http://java.sun.com/javaee/5/docs/api/' ]
         group(
             'Core API', [
                 'org.hibernate',
@@ -91,7 +93,7 @@
                 'org.hibernate.property',
                 'org.hibernate.loader*',
                 'org.hibernate.persister*',
-                ':org.hibernate.proxy',
+                'org.hibernate.proxy',
                 'org.hibernate.tuple',
                 'org.hibernate.transform',
                 'org.hibernate.collection',
@@ -114,55 +116,61 @@
         group (
             'Testing Support', ['org.hibernate.junit*']
         )
-        setJavadocExecHandleBuilder(
-                new org.gradle.external.javadoc.JavadocExecHandleBuilder() {
-                    public ExecAction getExecHandle() {
-                        try {
-                            options.write(optionsFile);
-                        } catch (IOException e) {
-                            throw new GradleException("Faild to store javadoc options.", e);
-                        }
-
-                        ExecAction execAction = new DefaultExecAction();
-                        execAction.workingDir(execDirectory);
-                        execAction.executable( "$jdk16_home/bin/javadoc" );
-                        execAction.args("@" + optionsFile.getAbsolutePath());
-
-                        options.contributeCommandLineOptions(execAction);
-
-                        return execAction;
-                    }
-                }
-        )
     }
 
-    parent.subprojects.each{ subproject->
-        if ( !subProjectsToSkipForJavadoc.contains( subproject.name ) ) {
-            subproject.sourceSets.each { set ->
-                if ( !"test".equals( set.name ) ) {
-                    source set.java
-
-                    if( classpath ) {
-                        classpath += set.classes + set.compileClasspath
-                    }
-                    else {
-                        classpath = set.classes + set.compileClasspath
-                    }
-                }
+//    parent.subprojects.each{ subProject->
+//        if ( !subProjectsToSkipForJavadoc.contains( subProject.name ) ) {
+//            subProject.sourceSets.each { set ->
+//                if ( !"test".equals( set.name ) ) {
+//                    source set.java
+//
+//                    if( classpath ) {
+//                        classpath += set.classes + set.compileClasspath
+//                    }
+//                    else {
+//                        classpath = set.classes + set.compileClasspath
+//                    }
+//                }
+//            }
+//        }
+//    }
+    aggregator {
+        excludeSourceSetName 'test'
+        parent.subprojects.each{ subProject->
+            if ( ! subProjectsToSkipForJavadoc.contains( subProject.name ) ) {
+                project subProject
             }
         }
     }
 }
 
+aggregateJavadocs.doLast {
+    copy {
+        from new File( projectDir, 'src/javadoc/images' )
+        into new File( javadocBuildDir.dir, "/images" )
+    }
+}
+
+
 // uber-jar ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-def List subProjectsToSkipForUberJar = ['testsuite','hibernate-testing'];
+def List subProjectsToSkipForUberJar = ['testsuite','hibernate-testing', 'hibernate-release'];
 
 releaseBuildDir = dir( buildDirName )
 
 task uberJar(type: Jar, dependsOn: [releaseBuildDir, needs16]) {
+    description = "Builds the hibernate3.jar 'uber-jar'"
     destinationDir = releaseBuildDir.dir
-    customName = 'hibernate3.jar'
+    archiveName = 'hibernate3.jar'
+
+    manifest.mainAttributes(
+            provider: 'gradle',
+            'Implementation-Url': 'http://hibernate.org',
+            'Implementation-Version': version,
+            'Implementation-Vendor': 'Hibernate.org',
+            'Implementation-Vendor-Id': 'org.hibernate'
+    )
+
     parent.subprojects.each { subproject->
         if ( !subProjectsToSkipForUberJar.contains( subproject.name ) ) {
             subproject.sourceSets.each { set ->
@@ -172,6 +180,15 @@
             }
         }
     }
+
+    from zipTree(
+        parent.project( 'hibernate-annotations' )
+                .configurations
+                .runtime
+                .fileCollection { dep -> dep.name == 'hibernate-commons-annotations' }
+                .filter { file -> file.name.startsWith( 'hibernate-commons-annotations' ) }
+                .singleFile
+    )
 }
 
 parent.subprojects.each { subproject ->
@@ -207,33 +224,71 @@
     }
 
     ['hibernate-c3p0', 'hibernate-proxool', 'hibernate-ehcache', 'hibernate-infinispan',
-            'hibernate-jbosscache', 'hibernate-oscache', 'hibernate-swarmcache',
-            'hibernate-entitymanager', 'hibernate-envers'].each { feature ->
+            'hibernate-jbosscache', 'hibernate-oscache', 'hibernate-swarmcache'].each { feature ->
         final String shortName = feature.substring( 'hibernate-'.length() );
         into('lib/optional/' + shortName) {
-            from ( parent.project( feature ).configurations.runtime
+            from (
+                    parent.project( feature ).configurations.runtime
                     - parent.project( 'hibernate-core' ).configurations.runtime
-                    - parent.project( 'hibernate-core' ).configurations.provided )
+                    - parent.project( 'hibernate-core' ).configurations.provided
+                    - parent.project( 'hibernate-annotations' ).configurations.runtime
+                    - parent.project( 'hibernate-annotations' ).configurations.provided
+            )
         }
     }
 
+    into( 'lib/jpa' ) {
+        from parent.project( 'hibernate-entitymanager' )
+                .configurations
+                .runtime
+                .fileCollection { dep -> dep.name == 'hibernate-jpa-2.0-api' }
+                .filter { file -> file.name.startsWith( 'hibernate-jpa-2.0-api' ) }
+    }
+
     into('documentation/manual') {
         from new File( project.buildDir, 'docbook/publish' )
     }
     
     into('documentation/javadocs') {
-        from javadocBuildDir
+        from javadocBuildDir.dir
     }
+
+    into( 'project' ) {
+        from ( rootProject.projectDir ) {
+            exclude( '**/target/**' )
+            exclude( '**/local/**' )
+            exclude( '**/build/**' )
+            exclude( '**/*.ipr' )
+            exclude( '**/*.iml' )
+            exclude( '**/*.iws' )
+            exclude( '**/atlassian-ide-plugin.xml' )
+            exclude( '**/.idea' )
+            exclude( '**/.classpath' )
+            exclude( '**/.project' )
+            exclude( '**/.settings' )
+            exclude( '**/.nbattrs' )
+            exclude( '**/*.log' )
+            exclude( '**/.svn' )
+            exclude( '**/.gradle/**' )
+        }
+    }
 }
 
 task buildReleaseZip( type: Zip, dependsOn: [prepareReleaseBundles] ) {
+    description = "Build release bundle in ZIP format"
     baseName = 'hibernate-release'
+    destinationDir = releaseBuildDir.dir
     with project.releaseCopySpec
 }
 
 task buildReleaseTgz( type: Tar, dependsOn: [prepareReleaseBundles] ) {
+    description = "Build release bundle in GZIP format"
     baseName = 'hibernate-release'
+    destinationDir = releaseBuildDir.dir
     compression = Compression.GZIP
     with project.releaseCopySpec
 }
 
+task buildReleaseBundles( dependsOn: [buildReleaseZip,buildReleaseTgz] ) {
+    description = "Build release bundle in all formats"
+}



More information about the hibernate-commits mailing list