-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
86 lines (74 loc) · 2.02 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
plugins {
id 'java'
id 'maven-publish'
id("java-library")
}
group 'hiof.gruppe1'
version '0.24'
repositories {
mavenCentral()
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}
task run(type: JavaExec) {
group = "Execution"
description = "Run the main class with JavaExecTask"
classpath = sourceSets.main.runtimeClasspath
mainClass = "hiof.gruppe1.Main"
}
dependencies {
// testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
// testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
implementation 'org.mariuszgromada.math:MathParser.org-mXparser:5.2.1'
implementation 'mysql:mysql-connector-java:8.0.32'
implementation 'org.xerial:sqlite-jdbc:3.39.3.0'
}
test {
useJUnitPlatform()
}
def DBExecutable = 'sqlite3'
def DBPath = 'src/main/java/resources'
def DBFile = 'estivateSQLite.db'
def DBSQLBackup = 'estivateCleanBackup.sql'
task backupDatabase(type: Exec) {
executable "${DBPath}/${DBExecutable}"
args "${DBPath}/${DBFile}",
".output ${DBPath}/${DBSQLBackup}",
".dump", ".exit"
}
task restoreDatabase() {
doFirst {
delete file("${DBPath}/${DBFile}")
}
doLast {
exec {
executable "${DBPath}/${DBExecutable}"
args "${DBPath}/${DBFile}",
".read ${DBPath}/${DBSQLBackup}",
".exit"
}
}
}
publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/jarlesyvertsen/estivateorm")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("GITHUB_USERNAME")
password = project.findProperty("gpr.key") ?: System.getenv("GITHUB_TOKEN")
}
}
}
publications {
gpr(MavenPublication) {
groupId = 'hiof.gruppe1'
artifactId = 'estivate-persist'
version = "0.24"
from (components.java)
}
}
}