-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
81 lines (70 loc) · 3.26 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import java.nio.file.Files
import java.nio.file.StandardCopyOption
import java.nio.file.attribute.PosixFilePermission
buildscript {
ext.projectVersion = '0.4.1-SNAPSHOT'
ext.projectName = 'kaifu2x'
ext.projectGroup = 'com.soywiz'
ext.projectDesc = 'Port of waifu2x to pure kotlin. Anime-style upscaler and noise reductor based on convolutional neural networks using coffee trained models'
ext.projectHost = 'github'
ext.projectOrg = 'soywiz'
ext.projectLicense = 'MIT'
ext.projectDevelNick = 'soywiz'
ext.projectDevelName = 'Carlos Ballesteros Velasco'
ext.projectInceptionYear = 2017
ext.kotlinVersion = '1.2.10'
ext.korioVersion = '0.18.7'
ext.korimVersion = '0.18.3'
repositories {
mavenLocal()
jcenter()
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath "gradle.plugin.com.soywiz:korlibs-build-gradle-plugin:0.1.7"
}
}
apply plugin: 'com.soywiz.korlibs-build-gradle-plugin'
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion"
compile "com.soywiz:korio:$korioVersion"
compile "com.soywiz:korim:$korimVersion"
compile "org.jogamp.jocl:jocl:2.3.2"
compile "org.jogamp.jocl:jocl:2.3.2:natives-macosx-universal"
compile "org.jogamp.jocl:jocl:2.3.2:natives-linux-i586"
compile "org.jogamp.jocl:jocl:2.3.2:natives-linux-amd64"
compile "org.jogamp.jocl:jocl:2.3.2:natives-windows-i586"
compile "org.jogamp.jocl:jocl:2.3.2:natives-windows-amd64"
compile "org.jogamp.gluegen:gluegen:2.3.2"
compile "org.jogamp.gluegen:gluegen-rt:2.3.2"
compile "org.jogamp.gluegen:gluegen-rt:2.3.2:natives-macosx-universal"
compile "org.jogamp.gluegen:gluegen-rt:2.3.2:natives-linux-i586"
compile "org.jogamp.gluegen:gluegen-rt:2.3.2:natives-linux-amd64"
compile "org.jogamp.gluegen:gluegen-rt:2.3.2:natives-windows-i586"
compile "org.jogamp.gluegen:gluegen-rt:2.3.2:natives-windows-amd64"
}
task fatJarCore(type: Jar) {
manifest {
attributes 'Implementation-Title': 'Kaifu2x',
'Main-Class': 'com.soywiz.kaifu2x.Kaifu2xCli'
}
baseName = project.name + '-all'
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}
task fatJarLauncher() {
doLast {
File launcherFile = new File(rootProject.buildDir, "libs/kaifu2x")
launcherFile.write("java -jar \$0-all-${version}.jar \$*")
Files.setPosixFilePermissions(launcherFile.toPath(), Files.getPosixFilePermissions(launcherFile.toPath()) + [PosixFilePermission.OWNER_EXECUTE, PosixFilePermission.GROUP_EXECUTE, PosixFilePermission.OTHERS_EXECUTE].toSet())
}
}
task fatJar(dependsOn: [fatJarCore, fatJarLauncher]) {
}
task installCli(dependsOn: fatJar) {
doLast {
Files.copy(new File(rootProject.buildDir, "libs/kaifu2x").toPath(), new File("/usr/local/bin/kaifu2x").toPath(), StandardCopyOption.REPLACE_EXISTING, StandardCopyOption.COPY_ATTRIBUTES)
Files.copy(new File(rootProject.buildDir, "libs/kaifu2x-all-${version}.jar").toPath(), new File("/usr/local/bin/kaifu2x-all-${version}.jar").toPath(), StandardCopyOption.REPLACE_EXISTING, StandardCopyOption.COPY_ATTRIBUTES)
}
}