-
Notifications
You must be signed in to change notification settings - Fork 145
/
build.gradle
104 lines (83 loc) · 2.38 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Java project to get you started.
* For more details take a look at the Java Quickstart chapter in the Gradle
* User Manual available at https://docs.gradle.org/6.5/userguide/tutorial_java_projects.html
*/
plugins {
// Apply the java plugin to add support for Java
id 'java'
// Apply the application plugin to add support for building a CLI application.
id 'application'
// shadowJar plugin to build fat jar
id 'com.github.johnrengelman.shadow' version '6.1.0'
//Add docker build and publish
id 'com.palantir.docker' version '0.34.0'
}
sourceCompatibility = JavaVersion.VERSION_11
repositories {
// Use jcenter for resolving dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
}
dependencies {
// Use JUnit test framework
testImplementation 'junit:junit:4.13'
implementation 'org.mozilla:rhino:1.7.14'
implementation 'com.h2database:h2:2.1.214'
implementation 'org.bouncycastle:bcpkix-jdk15on:1.69'
implementation "mysql:mysql-connector-java:8.0.26"
}
sourceSets {
main {
java {
srcDirs = ['src']
}
resources {
srcDirs = ['resources']
}
}
test {
java {
srcDirs = ['test']
}
}
}
// reproducible builds
tasks.withType(AbstractArchiveTask) {
preserveFileTimestamps = false
reproducibleFileOrder = true
}
compileJava {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
//options.compilerArgs << '-something'
}
application {
// Define the main class for the application.
mainClassName = 'org.minima.Minima'
}
jar {
manifest {
attributes 'Main-Class': 'org.minima.Minima'
}
}
docker {
name 'minimaglobal/minima:dev'
dockerfile project.file('docker/Dockerfile')
//Remove this for a local build - this is cross platform
buildx true
push true
platform 'linux/amd64,linux/arm64,linux/arm/v7'
//Other platfor formats
//platform 'amd64,arm32v7,arm64v8,windows-amd64'
files tasks.shadowJar
copySpec.from("$buildDir/lib/minima-all.jar",).into(".")
copySpec.from("docker/minima.config").into(".")
copySpec.from("docker/minima").into(".")
}
/*test {
dependsOn cleanTest
testLogging.showStandardStreams = true
}*/