-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.gradle
66 lines (51 loc) · 1.93 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
import org.pegdown.PegDownProcessor
buildscript {
repositories {
maven {
url('http://openbakery.org/repository/')
}
mavenCentral()
}
dependencies {
classpath group: 'org.openbakery', name: 'xcodePlugin', version: '0.8.0-beta6'
}
}
apply plugin: 'xcode'
xcodebuild {
sdk = 'macosx'
target = 'AutoIngest (Sparkle)'
configuration = 'Release'
}
task('sparkle-notes') {
def notes = "$System.env.CHANGELOG"
if (notes) {
def matcher = notes =~ /^\s*"(.*)"$/
if (notes ==~ /^<\w+>.*<\/\w+>$/) {
notes = notes;
} else {
// convert markdown
PegDownProcessor pegDownProcessor = new PegDownProcessor();
notes = pegDownProcessor.markdownToHtml(notes)
}
String html = "<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"><title>Release Notes</title></head><body>" + notes + "</body></html>";
new File("releasenotes.html").write(html, "UTF-8");
} else {
println "No notes found"
}
}
task sparkleZip(dependsOn:'xcodebuild') {
def directory = project.xcodebuild.symRoot.absolutePath + '/' + project.xcodebuild.configuration + '/AutoIngest.app/Contents'
def outputDirectory = ".";
if (project.hasProperty('sparkle.output')) {
outputDirectory = project['sparkle.output'];
}
doLast {
def ant = new groovy.util.AntBuilder()
ant.zip(destfile: outputDirectory + "/AutoIngest.zip") {
zipfileset ( prefix:"AutoIngest.app/Contents/", dir: directory, excludes : "MacOS/*", includes : "*/**");
zipfileset ( prefix:"AutoIngest.app/Contents/MacOS", dir: directory + "/MacOS", includes : "*", filemode : 755);
zipfileset ( prefix:"AutoIngest.app/Contents/Frameworks/Sparkle.framework/Resources/finish_installation.app/Contents/MacOS", dir: directory + "/Frameworks/Sparkle.framework/Resources/finish_installation.app/Contents/MacOS/", includes : "*", filemode : 755);
}
ant.move(file: "releasenotes.html", todir: outputDirectory, quiet: true)
}
}