Skip to content

Instantly share code, notes, and snippets.

@scottmarlow
Created April 1, 2014 18:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scottmarlow/9919741 to your computer and use it in GitHub Desktop.
Save scottmarlow/9919741 to your computer and use it in GitHub Desktop.
syncTckDeps
apply plugin: 'java'
repositories {
mavenCentral()
mavenLocal()
maven {
name 'jboss-nexus'
url "http://repository.jboss.org/nexus/content/groups/public/"
}
maven {
name "jboss-snapshots"
url "http://snapshots.jboss.org/maven2/"
}
}
defaultTasks 'syncTckDeps'
ext {
hibernateVersion = '4.3.5-SNAPSHOT'
jteFilePath = "${project.rootDir}/bin/ts-jenkins.jte"
jtePropKey = 'jpa.classes'
}
configurations {
all*.exclude group: 'xml-apis'
}
dependencies {
compile "org.hibernate:hibernate-entitymanager:${hibernateVersion}"
compile( "org.hibernate:hibernate-testing:${hibernateVersion}" ) {
transitive=false
}
compile 'log4j:log4j:1.2.17'
compile 'org.javassist:javassist:3.18.1-GA'
compile 'org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec:1.0.0.Final'
}
task syncTckDeps {
doFirst {
Properties jteProps = new Properties();
project.file( jteFilePath ).withReader { reader ->
jteProps.load( reader );
}
if ( jteProps.containsKey( jtePropKey ) ) {
jteProps.setProperty( jtePropKey, configurations.compile.getAsPath() );
project.file( jteFilePath ).withWriter { writer ->
jteProps.store( writer, "${new Date().toString()} : Programatically written to update Hibernate dependencies under ${jtePropKey}" );
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment