BUCK 1.54 KB
Newer Older
Wietse Kuipers's avatar
Wietse Kuipers committed
1
2
3
4
5
6
7
8
9
10
11
# To learn about Buck see [Docs](https://buckbuild.com/).
# To run your application with Buck:
# - install Buck
# - `npm start` - to start the packager
# - `cd android`
# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"`
# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck
# - `buck install -r android/app` - compile, install and run application
#

lib_deps = []
Wietse Kuipers's avatar
Wietse Kuipers committed
12

Wietse Kuipers's avatar
Wietse Kuipers committed
13
for jarfile in glob(['libs/*.jar']):
Wietse Kuipers's avatar
Wietse Kuipers committed
14
  name = 'jars__' + jarfile[jarfile.rindex('/') + 1: jarfile.rindex('.jar')]
Wietse Kuipers's avatar
Wietse Kuipers committed
15
16
17
18
19
20
21
  lib_deps.append(':' + name)
  prebuilt_jar(
    name = name,
    binary_jar = jarfile,
  )

for aarfile in glob(['libs/*.aar']):
Wietse Kuipers's avatar
Wietse Kuipers committed
22
  name = 'aars__' + aarfile[aarfile.rindex('/') + 1: aarfile.rindex('.aar')]
Wietse Kuipers's avatar
Wietse Kuipers committed
23
24
25
26
27
28
29
  lib_deps.append(':' + name)
  android_prebuilt_aar(
    name = name,
    aar = aarfile,
  )

android_library(
Wietse Kuipers's avatar
Wietse Kuipers committed
30
31
    name = "all-libs",
    exported_deps = lib_deps,
Wietse Kuipers's avatar
Wietse Kuipers committed
32
33
34
)

android_library(
Wietse Kuipers's avatar
Wietse Kuipers committed
35
36
37
38
39
40
41
42
43
    name = "app-code",
    srcs = glob([
        "src/main/java/**/*.java",
    ]),
    deps = [
        ":all-libs",
        ":build_config",
        ":res",
    ],
Wietse Kuipers's avatar
Wietse Kuipers committed
44
45
46
)

android_build_config(
Wietse Kuipers's avatar
Wietse Kuipers committed
47
48
    name = "build_config",
    package = "com.thaliapp",
Wietse Kuipers's avatar
Wietse Kuipers committed
49
50
51
)

android_resource(
Wietse Kuipers's avatar
Wietse Kuipers committed
52
53
54
    name = "res",
    package = "com.thaliapp",
    res = "src/main/res",
Wietse Kuipers's avatar
Wietse Kuipers committed
55
56
57
)

android_binary(
Wietse Kuipers's avatar
Wietse Kuipers committed
58
59
60
61
62
63
64
    name = "app",
    keystore = "//android/keystores:debug",
    manifest = "src/main/AndroidManifest.xml",
    package_type = "debug",
    deps = [
        ":app-code",
    ],
Wietse Kuipers's avatar
Wietse Kuipers committed
65
)