forked from matyasf/stardust-library-plumbee
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
118 lines (103 loc) · 3.91 KB
/
build.gradle
File metadata and controls
118 lines (103 loc) · 3.91 KB
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/*
Gradle script for building the library. Usage:
Have a local or a remote Maven repository which hosts the dependencies (only Starling 1.7.0 in this case)
Have a file called gradle.properties in [Users]/[UserName]/.gradle with the following contents:
mavenUsername=[the username to access your Maven repo]
mavenPassword=[password for your Maven repo]
flashPlayerLocation=C:\\[path to flash player]\\flashplayer.exe
(flashPlayerLocation is only needed if you want to run tests)
(OSX only) make the gradlew file in the root directory executable
Run gradlew build to build the .swc and run tests
Run gradlew assemble to build the .swc
Run gradlew tasks to list all other tasks, e.g. to make project files for Flash Builder or IntelliJ IDEA
*/
import org.apache.tools.ant.taskdefs.condition.Os
buildscript {
repositories {
mavenLocal()
maven {
url repoManagerURL + 'repo'
credentials {
username = mavenUsername
password = mavenPassword
}
}
}
dependencies {
classpath group: 'org.gradlefx', name: 'gradlefx', version: '1.3.1'
}
}
apply plugin: 'gradlefx'
apply plugin: 'ideafx'
apply plugin: 'maven'
group = 'com.funkypandagame'
version = '3.28'
type = 'swc'
output = 'stardust-library'
playerVersion = '20.0'
srcDirs = ['src/main/flex']
repositories {
mavenLocal()
maven {
url repoManagerURL + 'repo'
credentials {
username = mavenUsername
password = mavenPassword
}
}
ivy {
name 'Adobe Air SDK'
artifactPattern Os.isFamily(Os.FAMILY_WINDOWS) ?
'http://airdownload.adobe.com/air/win/download/[revision]/[module]_Compiler.[ext]' :
'http://airdownload.adobe.com/air/mac/download/[revision]/[module]_Compiler.[ext]'
}
}
dependencies {
airSDK group: 'com.adobe', name: 'AIRSDK', version: '20.0', ext: Os.isFamily(Os.FAMILY_WINDOWS) ? 'zip' : 'tbz2'
external 'com.gamua:starling-framework:1.7.0'
}
additionalCompilerOptions = [
'-inline',
// AS3 metadata
'-keep-as3-metadata+=Inline,Embed,SWF,Transient'
]
sdkAutoInstall {
showPrompts = false
}
///////////////////////////////////////// Wrapper
task wrapper(type: Wrapper) {
group = 'Buildmaster'
description = 'Generates gradlew and gradlew.bat bootstrap scripts.'
gradleVersion = '2.6'
// place jar file and properties into a subdirectory to avoid root dir clutter
jarFile = 'gradle/wrapper/gradle.jar'
}
///////////////////////////////////////// Maven
// this is a workaround, see https://github.com/GradleFx/GradleFx/issues/91
uploadArchives {
description 'Deploys the existing .swc to the local or remote Maven repository. Also creates the pom.xml file.'
repositories {
mavenDeployer {
// invoke this with the -PdeployToRepoManager command line argument
if (project.hasProperty('deployToRepoManager')) {
repository(url: repoManagerURL + 'funkypanda') {
authentication(userName: mavenUsername, password: mavenPassword)
}
}
else {
repository url: mavenLocal().url
}
//The publication doesn't know about our dependencies, so we have to manually add them to the pom
pom.withXml {
def dependenciesNode = asNode().appendNode('dependencies')
project.configurations["external"].allDependencies.each { Dependency dependency ->
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', dependency.group)
dependencyNode.appendNode('artifactId', dependency.name)
dependencyNode.appendNode('version', dependency.version)
dependencyNode.appendNode('type', 'swc')
}
}
}
}
}