alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Hibernate example source code file (documentation.gradle)

This example Hibernate source code file (documentation.gradle) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Hibernate tags/keywords

file, file, version, version, zip, zip

The Hibernate documentation.gradle source code

buildscript {
  repositories {
      mavenCentral()
      mavenLocal()
      mavenRepo name: "jboss", urls: "http://repository.jboss.org/nexus/content/groups/public/"
  }
  dependencies {
      classpath 'org.jboss.jdocbook:gradle-jdocbook:1.1.0'
  }
}

apply plugin: "java"
apply plugin: "jdocbook"

dependencies {
	jdocbookStyles "org.hibernate:hibernate-jdocbook-style:2.0.1"
}

defaultTasks 'buildDocs'

jdocbook {
    // apply shared formatting config ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    format('html_single') {
		finalName = "index.html"
		stylesheet = "classpath:/xslt/org/hibernate/jdocbook/xslt/xhtml-single.xsl"
	}
	format('html') {
		finalName = "index.html"
		stylesheet = "classpath:/xslt/org/hibernate/jdocbook/xslt/xhtml.xsl"
	}

    // book-specific config ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    quickstart {
        masterSourceDocumentName = 'Hibernate_Getting_Started_Guide.xml'
        // only html supported due to tutorials.zip
//        formats.pdf.enable = false
    }
	devguide {
		masterSourceDocumentName = 'Hibernate_Development_Guide.xml'
	}
// todo : need to remove this once all content moved to devguide
//	manual {
//		masterSourceDocumentName = 'HIBERNATE_-_Relational_Persistence_for_Idiomatic_Java.xml'
//		translation = ['de-DE','es-ES','fr-FR','ja-JP','pt-BR','zh-CN']
//	}
}

task buildTutorialZip(type: Zip) {
    destinationDir = file( "target/work/tutorials" )
    archiveName = 'hibernate-tutorials.zip'
    from 'src/main/docbook/quickstart/tutorials'
    // todo : this part does not work.  Asked on mailing list
    filter(
            org.apache.tools.ant.filters.ReplaceTokens,
            tokens: [VERSION: project.version]
    )
}

buildDocs.dependsOn buildTutorialZip

buildDocs.doLast {
    for ( File languageDir : dirList( "target/docbook/publish/quickstart" ) ) {
        for ( File formatDir : dirList( languageDir ) ) {
            final File copyDir = new File( formatDir, "files" );
            copyDir.mkdirs();
            ant.copy( file: buildTutorialZip.archivePath.getAbsolutePath(), todir: copyDir.getAbsolutePath() )
        }
    }
}

File[] dirList(String dirName) {
    return dirList( (File) file(dirName) );
}

File[] dirList(File dir) {
    return dir.listFiles({file -> file.isDirectory() } as FileFilter).sort();
}

Other Hibernate examples (source code examples)

Here is a short list of links related to this Hibernate documentation.gradle source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.