| 1 |
apply plugin: 'java' |
| 2 |
|
| 3 |
version = '1.2.7' |
| 4 |
|
| 5 |
tasks.withType(JavaCompile) { |
| 6 |
sourceCompatibility = 11 |
| 7 |
targetCompatibility = 11 |
| 8 |
options.compilerArgs << '-Xlint:all' |
| 9 |
} |
| 10 |
|
| 11 |
repositories { |
| 12 |
mavenCentral() |
| 13 |
} |
| 14 |
|
| 15 |
dependencies { |
| 16 |
implementation fileTree(dir: 'lib', |
| 17 |
includes: ['**/*.jar'], |
| 18 |
excludes: ['**/*-sources.jar', '**/*-javadoc.jar']) |
| 19 |
|
| 20 |
implementation 'org.apache.pdfbox:pdfbox:2.0.27' |
| 21 |
implementation 'org.apache.pdfbox:fontbox:2.0.27' |
| 22 |
|
| 23 |
implementation 'com.fasterxml.jackson.core:jackson-databind:2.14.1' |
| 24 |
|
| 25 |
implementation 'org.kordamp.ikonli:ikonli-javafx:12.3.1' |
| 26 |
implementation 'org.kordamp.ikonli:ikonli-materialdesign-pack:12.3.1' |
| 27 |
|
| 28 |
// jpki-wrapper dependencies |
| 29 |
runtimeOnly 'org.bouncycastle:bcpkix-jdk18on:1.72' |
| 30 |
runtimeOnly 'net.java.dev.jna:jna:5.12.1' |
| 31 |
runtimeOnly 'net.java.dev.jna:jna-platform:5.12.1' |
| 32 |
} |
| 33 |
|
| 34 |
sourceSets.main.resources { |
| 35 |
srcDirs = ['src/main/resources', 'src/main/java' ] |
| 36 |
} |
| 37 |
|
| 38 |
def defaultEncoding = 'UTF-8' |
| 39 |
tasks.withType(AbstractCompile).each { it.options.encoding = defaultEncoding } |
| 40 |
tasks.withType(GroovyCompile).each { it.groovyOptions.encoding = defaultEncoding } |
| 41 |
|
| 42 |
defaultTasks 'clean', 'build', 'exewrap' |
| 43 |
|
| 44 |
jar { |
| 45 |
manifest { |
| 46 |
attributes "Specification-Version": "${project.version}" |
| 47 |
attributes "Main-Class" : "net.osdn.jpki.pdf_signer.Main" |
| 48 |
attributes "Class-Path": sourceSets.main.runtimeClasspath.collect { "lib/$it.name" }.join(' ') |
| 49 |
} |
| 50 |
into('net/osdn/jpki/pdf_signer') { |
| 51 |
from("${projectDir}") { |
| 52 |
include('LICENSE.txt') |
| 53 |
} |
| 54 |
} |
| 55 |
} |
| 56 |
|
| 57 |
task copyLibraries(type: Copy) { |
| 58 |
setGroup("build") |
| 59 |
setDescription("Copy dependency libraries.") |
| 60 |
from (sourceSets.main.runtimeClasspath) { |
| 61 |
include '*.jar' |
| 62 |
} |
| 63 |
from('lib') { |
| 64 |
include '*.dll' |
| 65 |
} |
| 66 |
into "${buildDir}/package/lib/" |
| 67 |
} |
| 68 |
|
| 69 |
task createJavaRuntime(type: Exec, dependsOn: ['jar', 'copyLibraries']) { |
| 70 |
setGroup("build") |
| 71 |
setDescription("Create Java Runtime.") |
| 72 |
workingDir "${buildDir}/package/" |
| 73 |
commandLine 'cmd', '/c', 'CreateJRE.bat', "${jar.archiveFile.get()}", "lib", "-server" |
| 74 |
} |
| 75 |
|
| 76 |
task exewrap(type: Exec, dependsOn: 'jar') { |
| 77 |
setGroup("build") |
| 78 |
setDescription('Assembles the executable.') |
| 79 |
executable "${projectDir}/etc/exewrap.exe" |
| 80 |
args "-A", "x64", |
| 81 |
"-g", |
| 82 |
"-t", "11", |
| 83 |
"-a", "-Xms256m -Xmx768m", |
| 84 |
"-e", "SHARED", |
| 85 |
"-j", "${jar.archiveFile.get()}", |
| 86 |
"-i", "etc/ico/app.ico", |
| 87 |
"-o", "${buildDir}/package/${archivesBaseName}.exe", |
| 88 |
"-p", "JPKI PDF SIGNER", |
| 89 |
"-d", "JPKI PDF SIGNER", |
| 90 |
"-c", "(C) 2017-2023 HIRUKAWA Ryo", |
| 91 |
"-V", "${version}", |
| 92 |
"-v", "${version}" |
| 93 |
} |