-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
95 lines (77 loc) · 2.52 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
import org.ajoberstar.grgit.Grgit
import java.time.Instant
import java.time.format.DateTimeFormatter
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.1'
classpath 'org.ajoberstar:gradle-git:1.2.0'
}
}
plugins {
id 'net.researchgate.release' version '2.1.2'
id 'co.riiid.gradle' version "0.4.2"
}
apply plugin: 'application'
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'groovy'
group = 'net.zomis'
description = "Brainfuck Java interpreter and utility"
sourceCompatibility = 1.8
targetCompatibility = 1.8
mainClassName = 'net.zomis.brainf.ui.Brainduck'
repositories {
maven { url "http://repo.maven.apache.org/maven2" }
}
dependencies {
compile 'com.beust:jcommander:1.30'
compile group: 'org.controlsfx', name: 'controlsfx', version: '8.40.12'
compile group: 'org.fxmisc.richtext', name: 'richtextfx', version: '0.6.10'
compile group: 'org.codehaus.groovy', name: 'groovy-all', version:'2.4.4'
testCompile group: 'junit', name: 'junit', version:'4.11'
testCompile group: 'org.loadui', name: 'testFx', version:'3.1.2'
}
task dist << {
}
dist.dependsOn 'shadowJar'
dist.dependsOn 'test'
task fixVersion << {
def dir = new File(buildDir, 'resources/main')
dir.mkdirs()
def repo = Grgit.open()
def date = DateTimeFormatter.ISO_INSTANT.format(Instant.now())
def branchName = repo.branch.getCurrent().getName()
def commitHash = repo.log(maxCommits: 1)[0].id
def version = project.version
def fileContents = new StringBuilder()
fileContents.append "version=$version\n"
fileContents.append "branch=$branchName\n"
fileContents.append "commit=$commitHash\n"
fileContents.append "date=$date\n"
new File(dir, 'version.dat').text = fileContents.toString()
}
processResources.dependsOn 'fixVersion'
/*
github {
owner = 'Zomis'
repo = 'Brainduck'
def tokenFile = file('github.token')
String lastTag = Grgit.open().tag.list().last().fullName
lastTag = lastTag.substring(lastTag.lastIndexOf('/') + 1)
token = tokenFile.exists() ? tokenFile.text.trim() : tokenFile.absolutePath + ' missing'
tagName = lastTag
targetCommitish = 'master'
name = lastTag
// body = '# Brainduck\n\nRelease notes and stuff'
assets = [
'build/libs/' + project.name + '-' + project.version + '-all.jar'
]
draft = false
prerelease = false
}
// githubRelease.dependsOn release
*/