Created
April 1, 2014 18:12
-
-
Save scottmarlow/9919741 to your computer and use it in GitHub Desktop.
syncTckDeps
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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