Skip to content
This repository was archived by the owner on Oct 31, 2023. It is now read-only.

Commit 7794857

Browse files
committed
Add initial codebase
This is a very simple Android codebase that includes two apps. The apps share some code, but not all.
1 parent 8b14008 commit 7794857

File tree

17 files changed

+282
-0
lines changed

17 files changed

+282
-0
lines changed

.buckconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[java]
2+
src_roots = src
3+
[android]
4+
target = android-25
5+
build_tools_version = 26.0.2
6+
[ndk]
7+
ndk_version = 15.2.4203891
8+
gcc_version = 4.9
9+
app_platform = android-15
10+
cpu_abis = armv7, x86

apps/BUCK

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
android_binary(
2+
name = "mammals",
3+
manifest_skeleton = "mammals-app-manifest.xml",
4+
keystore = ":debug_keystore",
5+
deps = [
6+
"//src/com/facebook/example/mammals/activity:activity",
7+
],
8+
)
9+
10+
android_binary(
11+
name = "animals",
12+
manifest_skeleton = "animals-app-manifest.xml",
13+
keystore = ":debug_keystore",
14+
deps = [
15+
"//src/com/facebook/example/animals:animals",
16+
],
17+
)
18+
19+
keystore(
20+
name = "debug_keystore",
21+
properties = "debug.keystore.properties",
22+
store = "debug.keystore",
23+
)

apps/animals-app-manifest.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest
3+
xmlns:android="http://schemas.android.com/apk/res/android"
4+
package="com.facebook.example.cppmerge.animals"
5+
>
6+
7+
<application>
8+
</application>
9+
10+
</manifest>

apps/debug.keystore

2.19 KB
Binary file not shown.

apps/debug.keystore.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
key.alias=android
2+
key.store.password=android
3+
key.alias.password=android

apps/mammals-app-manifest.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest
3+
xmlns:android="http://schemas.android.com/apk/res/android"
4+
package="com.facebook.example.cppmerge.mammals"
5+
>
6+
7+
<application>
8+
</application>
9+
10+
</manifest>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Copyright 2018-present, Facebook, Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.facebook.example.animals;
18+
19+
import android.app.Activity;
20+
import android.os.Bundle;
21+
import android.widget.TextView;
22+
import com.facebook.example.mammals.SeaLion;
23+
24+
public class AnimalsActivity extends Activity {
25+
@Override
26+
public void onCreate(Bundle savedInstanceState) {
27+
super.onCreate(savedInstanceState);
28+
29+
String text =
30+
"Mammal: " + SeaLion.getDescription() + "\n" +
31+
"Bird: " + Penguin.getDescription();
32+
33+
TextView view = new TextView(this);
34+
setContentView(view);
35+
view.setText(text);
36+
}
37+
}

src/com/facebook/example/animals/BUCK

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
android_library(
2+
name = "animals",
3+
manifest = "manifest.xml",
4+
srcs = glob(["*.java"]),
5+
deps = [
6+
"//src/com/facebook/example/habitat:habitat",
7+
"//src/com/facebook/example/mammals:mammals",
8+
],
9+
visibility = ["PUBLIC"],
10+
)
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
* Copyright 2018-present, Facebook, Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.facebook.example.animals;
18+
19+
import com.facebook.example.habitat.Ice;
20+
21+
public class Penguin {
22+
public static String getDescription() {
23+
return getName() + " on " + Ice.getName();
24+
}
25+
26+
private static String getName() {
27+
return "penguin";
28+
}
29+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest
3+
xmlns:android="http://schemas.android.com/apk/res/android"
4+
package="com.facebook.example.animals"
5+
>
6+
7+
<application>
8+
9+
<activity android:name=".AnimalsActivity">
10+
<intent-filter>
11+
<action android:name="android.intent.action.MAIN" />
12+
<category android:name="android.intent.category.LAUNCHER" />
13+
</intent-filter>
14+
</activity>
15+
16+
</application>
17+
</manifest>

0 commit comments

Comments
 (0)