-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlang_android_lib.go
More file actions
77 lines (64 loc) · 1.73 KB
/
lang_android_lib.go
File metadata and controls
77 lines (64 loc) · 1.73 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
package main
import "path/filepath"
type androidLibrary struct {
androidShared
}
func (al *androidLibrary) templateAlias() string {
return "lang/android_lib"
}
func (al *androidLibrary) describe() string {
return "An android library"
}
func (al *androidLibrary) deployableConfig() deployableConfig {
return al
}
func (al *androidLibrary) GradlePlugins() []string {
return []string{
"com.android.library",
}
}
func (al *androidLibrary) buildscriptDependencies() []string {
return []string{
"com.android.tools.build:gradle",
}
}
func (al *androidLibrary) JenkinsCommands() []string {
return []string{"buildAndTest"}
}
func (al *androidLibrary) deployableBuildscriptDependencies() []string {
return []string{}
}
func (al *androidLibrary) deployableGradlePlugins() []string {
return []string{
"com.episode6.hackit.deployable.aar",
}
}
func (al *androidLibrary) deployableJenkinsCommands() []string {
return []string{"maybeDeploy"}
}
func (al *androidLibrary) generateLangSpecificFiles(data *ProjectData, subdir string) {
mainRoot := pathWithOptSubdir(subdir, "src", "main")
mainPath := filepath.Join(mainRoot, "java", data.Group.asPath())
testPath := pathWithOptSubdir(subdir, "src", "test", "java", data.Group.asPath())
mkdir(mainPath, testPath)
templateTemplateableToFile(
"proguard-rules.pro",
filepath.Join(subdir, "proguard-rules.pro"),
al,
data)
templateTemplateableToFile(
"src_files/AndroidManifest.xml",
filepath.Join(mainRoot, "AndroidManifest.xml"),
al,
data)
templateTemplateableToFile(
"src_files/SomeClass.java",
filepath.Join(mainPath, "SomeClass.java"),
al,
data)
templateTemplateableToFile(
"src_files/SomeClassTest.java",
filepath.Join(testPath, "SomeClassTest.java"),
al,
data)
}