Skip to content

Commit

Permalink
Updates for Gradle 7 support, tested and still works with Gradle 5
Browse files Browse the repository at this point in the history
  • Loading branch information
jonesde committed Mar 13, 2022
1 parent 5b9e276 commit e7d74fa
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,56 +48,56 @@ tasks.withType(JavaCompile) { options.compilerArgs << "-proc:none" }
tasks.withType(GroovyCompile) { options.compilerArgs << "-proc:none" }

dependencies {
compile project(':framework')
implementation project(':framework')

// Apache PDFBox
compile ('org.apache.pdfbox:pdfbox:2.0.25') // Apache 2.0
implementation ('org.apache.pdfbox:pdfbox:2.0.25') // Apache 2.0

// Apache FOP - Apache 2.0
// NOTE: in Apache FOP 2.6 the dependencies are really messed up, includes redundant fop-core, fop-events, fop-url
compile ('org.apache.xmlgraphics:fop-events:2.7') {
implementation ('org.apache.xmlgraphics:fop-events:2.7') {
exclude group: 'org.apache.ant'
}
compile ('org.apache.xmlgraphics:fop-util:2.7')
compile ('org.apache.xmlgraphics:fop-core:2.7') {
implementation ('org.apache.xmlgraphics:fop-util:2.7')
implementation ('org.apache.xmlgraphics:fop-core:2.7') {
exclude group: 'xalan'
exclude group: 'xml-apis' // can't exclude batik-ext but has some same classes as xml-apis so exclude that
exclude group: 'org.apache.ant'
exclude group: 'javax.servlet'
exclude group: 'javax.media'
exclude group: 'com.sun.media'
}
compile ('org.apache.xmlgraphics:batik-transcoder:1.14') {
implementation ('org.apache.xmlgraphics:batik-transcoder:1.14') {
exclude group: 'xalan'
exclude group: 'org.mozilla'
exclude group: 'org.python'
}
compile ('org.apache.xmlgraphics:batik-constants:1.14') {
implementation ('org.apache.xmlgraphics:batik-constants:1.14') {
exclude group: 'org.mozilla'
exclude group: 'org.python'
}
compile ('org.apache.xmlgraphics:batik-i18n:1.14') {
implementation ('org.apache.xmlgraphics:batik-i18n:1.14') {
exclude group: 'org.mozilla'
exclude group: 'org.python'
}

// NOTE: in theory Apache Avalon is not required for FOP 2.6, but getting runtime errors without it
compile group: 'org.apache.avalon.framework', name: 'avalon-framework-api', version: '4.3.1'
compile group: 'org.apache.avalon.framework', name: 'avalon-framework-impl', version: '4.3.1'
implementation group: 'org.apache.avalon.framework', name: 'avalon-framework-api', version: '4.3.1'
implementation group: 'org.apache.avalon.framework', name: 'avalon-framework-impl', version: '4.3.1'

compile 'xerces:xercesImpl:2.12.2'
implementation 'xerces:xercesImpl:2.12.2'

// barcode4j as a module to avoid required dependency on ant
compile module('net.sf.barcode4j:barcode4j:2.1')
compile module('net.sf.barcode4j:barcode4j-fop-ext:2.1')
implementation module('net.sf.barcode4j:barcode4j:2.1')
implementation module('net.sf.barcode4j:barcode4j-fop-ext:2.1')

// CSSBox (HTML/CSS to SVG, etc)
compile ('net.sf.cssbox:cssbox:4.17') { // LGPL <== NOTE!
implementation ('net.sf.cssbox:cssbox:4.17') { // LGPL <== NOTE!
exclude group: 'xalan'
exclude group: 'xml-apis' // can't exclude batik-ext but has some same classes as xml-apis so exclude that
}
// NOTE: this comes from a custom build, see: https://github.com/jonesde/CSSBoxPdf
compile name: 'cssbox-pdf', version: '1.0-SNAPSHOT' // LGPL <== NOTE!
implementation name: 'cssbox-pdf', version: '1.0-SNAPSHOT' // LGPL <== NOTE!
}

// by default the Java plugin runs test on build, change to not do that (only run test if explicit task)
Expand All @@ -112,7 +112,9 @@ jar {
archiveBaseName = jarBaseName
}
task copyDependencies { doLast {
copy { from (configurations.runtime - project(':framework').configurations.runtime - project(':framework').jar.archivePath)
// logger.lifecycle("configurations.runtimeClasspath: ${configurations.runtimeClasspath.files({true}).join('\n')}\n\n")
// logger.lifecycle("project(':framework').configurations.runtimeClasspath: ${project(':framework').configurations.runtimeClasspath.files({true}).join('\n')}")
copy { from (configurations.runtimeClasspath - project(':framework').configurations.runtimeClasspath - project(':framework').jar.archivePath)
into file(projectDir.absolutePath + '/lib') }
} }
copyDependencies.dependsOn cleanLib
Expand Down

0 comments on commit e7d74fa

Please sign in to comment.