This repository has been archived by the owner on Sep 3, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 512
/
scratch.gradle
71 lines (60 loc) · 2.29 KB
/
scratch.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
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath group: 'org.gradlefx', name: 'gradlefx', version: '1.2.0'
}
}
repositories {
ivy {
name 'Apache Flex'
artifactPattern 'http://archive.apache.org/dist/flex/[revision]/binaries/[module]-[revision]-bin.[ext]'
}
ivy {
name 'Player Globals'
artifactPattern 'http://fpdownload.macromedia.com/get/flashplayer/installers/archive/[module]/[module][revision].[ext]'
}
}
apply plugin: org.gradlefx.plugins.GradleFxPlugin
ext.getCommitID = { repository ->
def dirty = "git status --porcelain --ignore-submodules=dirty".execute(null, file(repository)).text.trim() ? "-dirty" : ""
def revision = "git rev-parse --short HEAD".execute(null, file(repository)).text.trim()
return revision ? revision + dirty : 'unknown'
}
def commonDir = ext.commonDir
def target = hasProperty('target') ? target : '11.6'
println "Target is: $target"
def config = new ConfigSlurper(target).parse(file("${commonDir}/config.groovy").toURL())
type = 'mobile'
version = '1.0-SNAPSHOT'
frameworkLinkage = 'none'
buildDir = "${buildDir}/${target}" // GradleFX does an out-of-date check on the whole build dir
output = config.get('output')
playerVersion = config.get('playerVersion')
def scratchFlashCommitID = getCommitID(commonDir)
println "Commit ID for scratch-flash is: ${scratchFlashCommitID}"
dependencies {
flexSDK group: 'org.apache', name: 'apache-flex-sdk', version: '4.15.0', ext: 'zip'
external group: 'macromedia.com', name: 'playerglobal', version: playerVersion.replace('.', '_'), ext: 'swc'
merged files(
"${commonDir}/libs/as3corelib.swc",
"${commonDir}/libs/blooddy_crypto.swc",
"${commonDir}/libs/grabcut.swc"
)
}
sdkAutoInstall {
showPrompts = false
}
additionalCompilerOptions = [
"-library-path+=libs/framework.swc", // in the SDK's frameworks directory
"-library-path+=libs/osmf.swc", // in the SDK's frameworks directory
"-target-player=${playerVersion}",
"-default-size=800,600",
"-define+=SCRATCH::revision,'${scratchFlashCommitID}'",
"-advanced-telemetry",
]
additionalCompilerOptions += config.get('additionalCompilerOptions')
task wrapper(type: Wrapper) {
gradleVersion = '2.5'
}