Skip to content

Commit f49250d

Browse files
committed
publish v1.0.1
0 parents  commit f49250d

File tree

207 files changed

+8010
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

207 files changed

+8010
-0
lines changed

.buckconfig

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
[android]
3+
target = Google Inc.:Google APIs:23
4+
5+
[maven_repositories]
6+
central = https://repo1.maven.org/maven2

.flowconfig

+99
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
[ignore]
2+
3+
# We fork some components by platform.
4+
.*/*.web.js
5+
.*/*.android.js
6+
7+
# Some modules have their own node_modules with overlap
8+
.*/node_modules/node-haste/.*
9+
10+
# Ugh
11+
.*/node_modules/babel.*
12+
.*/node_modules/babylon.*
13+
.*/node_modules/invariant.*
14+
15+
# Ignore react and fbjs where there are overlaps, but don't ignore
16+
# anything that react-native relies on
17+
.*/node_modules/fbjs/lib/Map.js
18+
.*/node_modules/fbjs/lib/ErrorUtils.js
19+
20+
# Flow has a built-in definition for the 'react' module which we prefer to use
21+
# over the currently-untyped source
22+
.*/node_modules/react/react.js
23+
.*/node_modules/react/lib/React.js
24+
.*/node_modules/react/lib/ReactDOM.js
25+
26+
.*/__mocks__/.*
27+
.*/__tests__/.*
28+
29+
.*/commoner/test/source/widget/share.js
30+
31+
# Ignore commoner tests
32+
.*/node_modules/commoner/test/.*
33+
34+
# See https://github.com/facebook/flow/issues/442
35+
.*/react-tools/node_modules/commoner/lib/reader.js
36+
37+
# Ignore jest
38+
.*/node_modules/jest-cli/.*
39+
40+
# Ignore Website
41+
.*/website/.*
42+
43+
# Ignore generators
44+
.*/local-cli/generator.*
45+
46+
# Ignore BUCK generated folders
47+
.*\.buckd/
48+
49+
# Ignore RNPM
50+
.*/local-cli/rnpm/.*
51+
52+
.*/node_modules/is-my-json-valid/test/.*\.json
53+
.*/node_modules/iconv-lite/encodings/tables/.*\.json
54+
.*/node_modules/y18n/test/.*\.json
55+
.*/node_modules/spdx-license-ids/spdx-license-ids.json
56+
.*/node_modules/spdx-exceptions/index.json
57+
.*/node_modules/resolve/test/subdirs/node_modules/a/b/c/x.json
58+
.*/node_modules/resolve/lib/core.json
59+
.*/node_modules/jsonparse/samplejson/.*\.json
60+
.*/node_modules/json5/test/.*\.json
61+
.*/node_modules/ua-parser-js/test/.*\.json
62+
.*/node_modules/builtin-modules/builtin-modules.json
63+
.*/node_modules/binary-extensions/binary-extensions.json
64+
.*/node_modules/url-regex/tlds.json
65+
.*/node_modules/joi/.*\.json
66+
.*/node_modules/isemail/.*\.json
67+
.*/node_modules/tr46/.*\.json
68+
69+
70+
[include]
71+
72+
[libs]
73+
node_modules/react-native/Libraries/react-native/react-native-interface.js
74+
node_modules/react-native/flow
75+
flow/
76+
77+
[options]
78+
module.system=haste
79+
80+
esproposal.class_static_fields=enable
81+
esproposal.class_instance_fields=enable
82+
83+
experimental.strict_type_args=true
84+
85+
munge_underscores=true
86+
87+
module.name_mapper='^image![a-zA-Z0-9$_-]+$' -> 'GlobalImageStub'
88+
module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub'
89+
90+
suppress_type=$FlowIssue
91+
suppress_type=$FlowFixMe
92+
suppress_type=$FixMe
93+
94+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(2[0-7]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
95+
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(2[0-7]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
96+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
97+
98+
[version]
99+
^0.30.0

.gitignore

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
bundles/
2+
3+
# OSX
4+
#
5+
.DS_Store
6+
7+
# Xcode
8+
#
9+
build/
10+
*.pbxuser
11+
!default.pbxuser
12+
*.mode1v3
13+
!default.mode1v3
14+
*.mode2v3
15+
!default.mode2v3
16+
*.perspectivev3
17+
!default.perspectivev3
18+
xcuserdata
19+
*.xccheckout
20+
*.moved-aside
21+
DerivedData
22+
*.hmap
23+
*.ipa
24+
*.xcuserstate
25+
project.xcworkspace
26+
27+
# Android/IJ
28+
#
29+
*.iml
30+
.idea
31+
.gradle
32+
local.properties
33+
34+
# node.js
35+
#
36+
node_modules/
37+
npm-debug.log
38+
39+
# BUCK
40+
buck-out/
41+
\.buckd/
42+
android/app/libs
43+
android/keystores/debug.keystore

.tags

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
getDefaultProps /Users/penn/Desktop/React Native/GitHubPopular/app/NavigationBar.js /^ getDefaultProps() {$/;" function line:28
2+
leftView /Users/penn/Desktop/React Native/GitHubPopular/app/NavigationBar.js /^ leftView(){$/;" function line:35
3+
onLeftButtonClick /Users/penn/Desktop/React Native/GitHubPopular/app/NavigationBar.js /^ onLeftButtonClick(){$/;" function line:54
4+
rightView /Users/penn/Desktop/React Native/GitHubPopular/app/NavigationBar.js /^ rightView(){$/;" function line:58
5+
onRightButtonClick /Users/penn/Desktop/React Native/GitHubPopular/app/NavigationBar.js /^ onRightButtonClick(){$/;" function line:76
6+
render /Users/penn/Desktop/React Native/GitHubPopular/app/NavigationBar.js /^ render:function() {$/;" function line:79
7+
ReactNative /Users/penn/Desktop/React Native/GitHubPopular/app/RepositoryDetail.js /^var ReactNative=require('react-native');$/;" variable line:7
8+
NavigationBar /Users/penn/Desktop/React Native/GitHubPopular/app/RepositoryDetail.js /^var NavigationBar=require('.\/NavigationBar');$/;" variable line:17
9+
FavoriteDao /Users/penn/Desktop/React Native/GitHubPopular/app/RepositoryDetail.js /^var FavoriteDao=require('.\/dao\/FavoriteDao');$/;" variable line:18
10+
WEBVIEW_REF /Users/penn/Desktop/React Native/GitHubPopular/app/RepositoryDetail.js /^var WEBVIEW_REF = 'webview';$/;" variable line:20
11+
getInitialState /Users/penn/Desktop/React Native/GitHubPopular/app/RepositoryDetail.js /^ getInitialState(){$/;" function line:22
12+
componentWillUnmount /Users/penn/Desktop/React Native/GitHubPopular/app/RepositoryDetail.js /^ componentWillUnmount:function(){$/;" function line:31
13+
setFavoriteState /Users/penn/Desktop/React Native/GitHubPopular/app/RepositoryDetail.js /^ setFavoriteState(isFavorite:boolean){$/;" function line:34
14+
onRightButtonClick /Users/penn/Desktop/React Native/GitHubPopular/app/RepositoryDetail.js /^ onRightButtonClick(){\/\/favoriteIcon单击回调函数$/;" function line:40
15+
onLeftButtonClick /Users/penn/Desktop/React Native/GitHubPopular/app/RepositoryDetail.js /^ onLeftButtonClick(){$/;" function line:49
16+
onNavigationStateChange /Users/penn/Desktop/React Native/GitHubPopular/app/RepositoryDetail.js /^ onNavigationStateChange(navState:Object) {$/;" function line:56
17+
render /Users/penn/Desktop/React Native/GitHubPopular/app/RepositoryDetail.js /^ render:function() {$/;" function line:65
18+
RepositoryDetail /Users/penn/Desktop/React Native/GitHubPopular/app/RepositoryDetail.js /^var RepositoryDetail=React.createClass({$/;" variable line:21
19+
const.HERBST /Users/penn/Desktop/React Native/GitHubPopular/app/common/MPColors.js /^const LOCATION_COLORS = {$/;" property line:8
20+
const.HERBST A /Users/penn/Desktop/React Native/GitHubPopular/app/common/MPColors.js /^ 'HERBST': '#00E3AD',$/;" property line:9
21+
const.HERBST B /Users/penn/Desktop/React Native/GitHubPopular/app/common/MPColors.js /^ 'HERBST A': '#00E3AD',$/;" property line:10
22+
const.HACKER X /Users/penn/Desktop/React Native/GitHubPopular/app/common/MPColors.js /^ 'HERBST B': '#00E3AD',$/;" property line:11
23+
const.HACKER Y /Users/penn/Desktop/React Native/GitHubPopular/app/common/MPColors.js /^ 'HACKER X': '#4D99EF',$/;" property line:12
24+
const.COWELL /Users/penn/Desktop/React Native/GitHubPopular/app/common/MPColors.js /^ 'HACKER Y': '#CF72B1',$/;" property line:13
25+
const.COWELL C /Users/penn/Desktop/React Native/GitHubPopular/app/common/MPColors.js /^ 'COWELL': '#6A6AD5',$/;" property line:14
26+
const.FOOD TENT /Users/penn/Desktop/React Native/GitHubPopular/app/common/MPColors.js /^ 'COWELL C': '#6A6AD5',$/;" property line:15
27+
colorForLocation /Users/penn/Desktop/React Native/GitHubPopular/app/common/MPColors.js /^function colorForLocation(location: ?string): string {$/;" function line:19
28+
colorForTopic /Users/penn/Desktop/React Native/GitHubPopular/app/common/MPColors.js /^function colorForTopic(count: number, index: number): string {$/;" function line:32
29+
module.exports.actionText /Users/penn/Desktop/React Native/GitHubPopular/app/common/MPColors.js /^module.exports = {$/;" property line:37
30+
module.exports.inactiveText /Users/penn/Desktop/React Native/GitHubPopular/app/common/MPColors.js /^ actionText: '#3FB4CF',$/;" property line:38
31+
module.exports.darkText /Users/penn/Desktop/React Native/GitHubPopular/app/common/MPColors.js /^ inactiveText: '#9B9B9B',$/;" property line:39
32+
module.exports.lightText /Users/penn/Desktop/React Native/GitHubPopular/app/common/MPColors.js /^ darkText: '#032250',$/;" property line:40
33+
module.exports.cellBorder /Users/penn/Desktop/React Native/GitHubPopular/app/common/MPColors.js /^ lightText: '#7F91A7',$/;" property line:41
34+
module.exports.darkBackground /Users/penn/Desktop/React Native/GitHubPopular/app/common/MPColors.js /^ cellBorder: '#EEEEEE',$/;" property line:42
35+
updateFavorite /Users/penn/Desktop/React Native/GitHubPopular/index.android.js /^var updateFavorite;$/;" variable line:26
36+
getInitialState /Users/penn/Desktop/React Native/GitHubPopular/index.android.js /^ getInitialState: function() {$/;" function line:28
37+
componentDidMount /Users/penn/Desktop/React Native/GitHubPopular/index.android.js /^ componentDidMount:function(){$/;" function line:33
38+
onSelected /Users/penn/Desktop/React Native/GitHubPopular/index.android.js /^ onSelected:function(object:string) {$/;" function line:37
39+
_renderScene /Users/penn/Desktop/React Native/GitHubPopular/index.android.js /^ _renderScene(route, navigator) {$/;" function line:43
40+
_navigator /Users/penn/Desktop/React Native/GitHubPopular/index.android.js /^ _navigator(defaultComponent,defaultName){$/;" function line:49
41+
_popularNavigator /Users/penn/Desktop/React Native/GitHubPopular/index.android.js /^ _popularNavigator(){$/;" function line:64
42+
onTabSelect /Users/penn/Desktop/React Native/GitHubPopular/index.android.js /^ onTabSelect(tab: Tab) {$/;" function line:95
43+
renderNavigationView /Users/penn/Desktop/React Native/GitHubPopular/index.android.js /^ renderNavigationView() {$/;" function line:104
44+
renderContent /Users/penn/Desktop/React Native/GitHubPopular/index.android.js /^ renderContent() {$/;" function line:131
45+
switch /Users/penn/Desktop/React Native/GitHubPopular/index.android.js /^ switch (this.state.selectedTab) {$/;" function line:132
46+
render /Users/penn/Desktop/React Native/GitHubPopular/index.android.js /^ render:function() {$/;" function line:146
47+
GitHubPopular /Users/penn/Desktop/React Native/GitHubPopular/index.android.js /^var GitHubPopular=React.createClass({$/;" variable line:27
48+
RepositoryCell /Users/penn/Desktop/React Native/GitHubPopular/app/PopularPage.js /^var RepositoryCell=require('.\/RepositoryCell')$/;" variable line:18
49+
getInitialState /Users/penn/Desktop/React Native/GitHubPopular/app/PopularPage.js /^ getInitialState: function(){$/;" function line:34
50+
componentDidMount /Users/penn/Desktop/React Native/GitHubPopular/app/PopularPage.js /^ componentDidMount:function(){$/;" function line:46
51+
componentWillReceiveProps /Users/penn/Desktop/React Native/GitHubPopular/app/PopularPage.js /^ componentWillReceiveProps:function(nextProps:Object) {\/\/当从当前页面切换走,再切换回来后$/;" function line:51
52+
updateFavorite /Users/penn/Desktop/React Native/GitHubPopular/app/PopularPage.js /^ updateFavorite(selectedTab:string){$/;" function line:55
53+
flushFavoriteState /Users/penn/Desktop/React Native/GitHubPopular/app/PopularPage.js /^ flushFavoriteState(){\/\/更新ProjectItem的Favorite状态$/;" function line:59
54+
getFavoriteKeys /Users/penn/Desktop/React Native/GitHubPopular/app/PopularPage.js /^ getFavoriteKeys(isFlush:boolean){\/\/获取本地用户收藏的ProjectItem$/;" function line:72
55+
genFetchUrl /Users/penn/Desktop/React Native/GitHubPopular/app/PopularPage.js /^ genFetchUrl(category:string){$/;" function line:86
56+
fetchCache /Users/penn/Desktop/React Native/GitHubPopular/app/PopularPage.js /^ fetchCache(){$/;" function line:89
57+
loadData /Users/penn/Desktop/React Native/GitHubPopular/app/PopularPage.js /^ loadData:function(){$/;" function line:107
58+
onRefresh /Users/penn/Desktop/React Native/GitHubPopular/app/PopularPage.js /^ onRefresh :function() {$/;" function line:131
59+
getDataSource /Users/penn/Desktop/React Native/GitHubPopular/app/PopularPage.js /^ getDataSource:function(items:Array<any>):ListView.DataSource{$/;" function line:134
60+
onSelectRepository /Users/penn/Desktop/React Native/GitHubPopular/app/PopularPage.js /^ onSelectRepository:function(projectModel:Object) {$/;" function line:137
61+
onFavorite /Users/penn/Desktop/React Native/GitHubPopular/app/PopularPage.js /^ onFavorite(item:Object,isFavorite:boolean){\/\/favoriteIcon单击回调函数$/;" function line:149
62+
checkFavorite /Users/penn/Desktop/React Native/GitHubPopular/app/PopularPage.js /^ checkFavorite(item:Object){\/\/检查该Item是否被收藏$/;" function line:156
63+
renderRow /Users/penn/Desktop/React Native/GitHubPopular/app/PopularPage.js /^ renderRow:function($/;" function line:164
64+
renderSeparator /Users/penn/Desktop/React Native/GitHubPopular/app/PopularPage.js /^ renderSeparator: function($/;" function line:182
65+
render /Users/penn/Desktop/React Native/GitHubPopular/app/PopularPage.js /^ render() {$/;" function line:196
66+
styles /Users/penn/Desktop/React Native/GitHubPopular/app/PopularPage.js /^var styles = StyleSheet.create({$/;" variable line:234
67+
getInitialState /Users/penn/Desktop/React Native/GitHubPopular/app/FavoritePage.js /^ getInitialState: function(){$/;" function line:27
68+
componentDidMount /Users/penn/Desktop/React Native/GitHubPopular/app/FavoritePage.js /^ componentDidMount:function(){$/;" function line:37
69+
componentWillReceiveProps /Users/penn/Desktop/React Native/GitHubPopular/app/FavoritePage.js /^ componentWillReceiveProps:function(nextProps:Object) {\/\/当从当前页面切换走,再切换回来后$/;" function line:40
70+
loadData /Users/penn/Desktop/React Native/GitHubPopular/app/FavoritePage.js /^ loadData:function(isShowLoading:boolean){$/;" function line:43
71+
onRefresh /Users/penn/Desktop/React Native/GitHubPopular/app/FavoritePage.js /^ onRefresh :function() {$/;" function line:66
72+
getDataSource /Users/penn/Desktop/React Native/GitHubPopular/app/FavoritePage.js /^ getDataSource:function(items:Array<any>):ListView.DataSource{$/;" function line:69
73+
onSelectRepository /Users/penn/Desktop/React Native/GitHubPopular/app/FavoritePage.js /^ onSelectRepository:function(projectModel:Object) {$/;" function line:72
74+
onFavorite /Users/penn/Desktop/React Native/GitHubPopular/app/FavoritePage.js /^ onFavorite(item:Object,isFavorite:boolean){$/;" function line:83
75+
renderRow /Users/penn/Desktop/React Native/GitHubPopular/app/FavoritePage.js /^ renderRow:function($/;" function line:90
76+
renderSeparator /Users/penn/Desktop/React Native/GitHubPopular/app/FavoritePage.js /^ renderSeparator: function($/;" function line:104
77+
render /Users/penn/Desktop/React Native/GitHubPopular/app/FavoritePage.js /^ render() {$/;" function line:118
78+
RepositoryCell /Users/penn/Desktop/React Native/GitHubPopular/app/FavoritePage.js /^var RepositoryCell=require('.\/RepositoryCell')$/;" variable line:17
79+
styles /Users/penn/Desktop/React Native/GitHubPopular/app/FavoritePage.js /^var styles = StyleSheet.create({$/;" variable line:154
80+
ReactNative /Users/penn/Desktop/React Native/GitHubPopular/app/AboutPage.js /^var ReactNative=require('react-native');$/;" variable line:7
81+
render /Users/penn/Desktop/React Native/GitHubPopular/app/AboutPage.js /^ render:function() {$/;" function line:18
82+
NavigationBar /Users/penn/Desktop/React Native/GitHubPopular/app/AboutPage.js /^var NavigationBar=require('.\/NavigationBar')$/;" variable line:16

.tags1

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
2+
!_TAG_FILE_SORTED 0 /0=unsorted, 1=sorted, 2=foldcase/
3+
!_TAG_PROGRAM_AUTHOR Darren Hiebert /[email protected]/
4+
!_TAG_PROGRAM_NAME Exuberant Ctags //
5+
!_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/
6+
!_TAG_PROGRAM_VERSION 5.8 //
7+
ReactNative /Users/penn/Desktop/React Native/GitHubPopular/app/AboutPage.js /^var ReactNative=require('react-native');$/;" variable line:7
8+
render /Users/penn/Desktop/React Native/GitHubPopular/app/AboutPage.js /^ render:function() {$/;" function line:18
9+
NavigationBar /Users/penn/Desktop/React Native/GitHubPopular/app/AboutPage.js /^var NavigationBar=require('.\/NavigationBar')$/;" variable line:16

.watchmanconfig

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

API.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
## GitHub Popular API
2+
- URL:https://api.github.com/search/repositories?
3+
- 查询所有的:q=stars:>1&sort=stars
4+
- 分类查询:q=ios&sort=stars
5+
6+
7+
## Usage:
8+
// var API_URL ='https://api.github.com/search/repositories?q=ios&sort=stars';
9+
10+
// var API_URL ='https://api.github.com/search/repositories?q=stars:>1&sort=stars';

README.en.md

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# GitHubPopular
2+
This is a GitHub most popular repositories viewer with React Native.
3+
## DownLoad APP
4+
Android:
5+
[GitHubPopular-release-v1.0.0.apk](https://raw.githubusercontent.com/crazycodeboy/GitHubPopular/master/resource/apk/GitHubPopular-release-v1.0.0.apk)
6+
![GitHubPopular-release-v1.0.0-Android](./resource/apk/GitHubPopular-release-v1.0.0-Android.png)
7+
## How does it look like?
8+
iOS:
9+
![GitHubPopular Preview-iOS](./resource/screenshot/GitHubPopular Preview-iOS.gif)
10+
Android:
11+
![GitHubPopular Preview-Android](./resource/screenshot/GitHubPopular Preview-Android.gif)
12+
## How to run
13+
14+
1. Prepare your environment: [Requirements](http://facebook.github.io/react-native/docs/getting-started.html#requirements)
15+
2. Clone [GitHubPopular](https://github.com/crazycodeboy/GitHubPopular.git), and goto the project root directory.
16+
3. run `npm i`.
17+
4. run `react-native run-ios` or `react-native run-android`.
18+
5. Yeah. You make it.

README.md

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# GitHub Popular
2+
3+
这是一个用来查看GitHub最受欢迎与最热项目的App,它基于React Native支持Android和iOS双平台。
4+
5+
## 目录
6+
7+
* [功能与特性](#功能与特性)
8+
* [下载安装](#下载安装)
9+
* [预览图](#预览图)
10+
* [ToDo](#todo)
11+
12+
## 功能与特性
13+
14+
* 支持订阅 50 多种编程语言;
15+
* 支持添加/删除编程语言,并支持自定义它们的排序;
16+
* 支持收藏喜欢的项目;
17+
* 支持多种颜色主题自由切换;
18+
* 支持搜索,并自持自定义订阅关键字;
19+
* 支持分享,轻松将自己喜欢的项目分享给好友;
20+
21+
## 下载安装
22+
23+
![下载](https://raw.githubusercontent.com/crazycodeboy/crazycodeboy.github.io/master/io/GitHubPopular/img/baidushoujizhushou.png)[前往下载](http://sj.qq.com/myapp/detail.htm?apkName=com.jph.githubpopular)
24+
![下载](https://raw.githubusercontent.com/crazycodeboy/crazycodeboy.github.io/master/io/GitHubPopular/img/yingyingbao.png)[前往下载](http://shouji.baidu.com/software/10123273.html)
25+
26+
27+
## 预览图
28+
29+
![GitHub Popular](./resource/screenshot/GitHubPopular-1.jpg)
30+
31+
![GitHub Popular](./resource/screenshot/GitHubPopular-2.jpg)
32+
33+
![GitHub Popular](./resource/screenshot/GitHubPopular-3.jpg)
34+
35+
## ToDo
36+
37+
**V2.0规划**
38+
39+
- [ ] 上滑动自动隐藏NavBar
40+
- [ ] 文字支持大、中、小
41+
- [ ] 夜间模式
42+
- [ ] 使用Redux
43+
- [ ] i18国际化国际化
44+
45+
46+

android/app/BUCK

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
import re
2+
3+
# To learn about Buck see [Docs](https://buckbuild.com/).
4+
# To run your application with Buck:
5+
# - install Buck
6+
# - `npm start` - to start the packager
7+
# - `cd android`
8+
# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US`
9+
# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck
10+
# - `buck install -r android/app` - compile, install and run application
11+
#
12+
13+
lib_deps = []
14+
for jarfile in glob(['libs/*.jar']):
15+
name = 'jars__' + re.sub(r'^.*/([^/]+)\.jar$', r'\1', jarfile)
16+
lib_deps.append(':' + name)
17+
prebuilt_jar(
18+
name = name,
19+
binary_jar = jarfile,
20+
)
21+
22+
for aarfile in glob(['libs/*.aar']):
23+
name = 'aars__' + re.sub(r'^.*/([^/]+)\.aar$', r'\1', aarfile)
24+
lib_deps.append(':' + name)
25+
android_prebuilt_aar(
26+
name = name,
27+
aar = aarfile,
28+
)
29+
30+
android_library(
31+
name = 'all-libs',
32+
exported_deps = lib_deps
33+
)
34+
35+
android_library(
36+
name = 'app-code',
37+
srcs = glob([
38+
'src/main/java/**/*.java',
39+
]),
40+
deps = [
41+
':all-libs',
42+
':build_config',
43+
':res',
44+
],
45+
)
46+
47+
android_build_config(
48+
name = 'build_config',
49+
package = 'com.test_new_edition',
50+
)
51+
52+
android_resource(
53+
name = 'res',
54+
res = 'src/main/res',
55+
package = 'com.test_new_edition',
56+
)
57+
58+
android_binary(
59+
name = 'app',
60+
package_type = 'debug',
61+
manifest = 'src/main/AndroidManifest.xml',
62+
keystore = '//android/keystores:debug',
63+
deps = [
64+
':app-code',
65+
],
66+
)

0 commit comments

Comments
 (0)