Skip to content

Commit 68c6115

Browse files
committed
add sth
1 parent 6152a71 commit 68c6115

File tree

2,860 files changed

+259235
-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.

2,860 files changed

+259235
-0
lines changed
Lines changed: 6 additions & 0 deletions
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
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
[ignore]
2+
3+
# We fork some components by platform.
4+
.*/*[.]android.js
5+
6+
# Ignore templates with `@flow` in header
7+
.*/local-cli/generator.*
8+
9+
# Ignore malformed json
10+
.*/node_modules/y18n/test/.*\.json
11+
12+
# Ignore the website subdir
13+
<PROJECT_ROOT>/website/.*
14+
15+
# Ignore BUCK generated dirs
16+
<PROJECT_ROOT>/\.buckd/
17+
18+
# Ignore unexpected extra @providesModule
19+
.*/node_modules/commoner/test/source/widget/share.js
20+
.*/node_modules/.*/node_modules/fbjs/.*
21+
22+
# Ignore duplicate module providers
23+
# For RN Apps installed via npm, "Libraries" folder is inside node_modules/react-native but in the source repo it is in the root
24+
.*/Libraries/react-native/React.js
25+
.*/Libraries/react-native/ReactNative.js
26+
.*/node_modules/jest-runtime/build/__tests__/.*
27+
28+
[include]
29+
30+
[libs]
31+
node_modules/react-native/Libraries/react-native/react-native-interface.js
32+
node_modules/react-native/flow
33+
flow/
34+
35+
[options]
36+
module.system=haste
37+
38+
esproposal.class_static_fields=enable
39+
esproposal.class_instance_fields=enable
40+
41+
experimental.strict_type_args=true
42+
43+
munge_underscores=true
44+
45+
module.name_mapper='^image![a-zA-Z0-9$_-]+$' -> 'GlobalImageStub'
46+
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'
47+
48+
suppress_type=$FlowIssue
49+
suppress_type=$FlowFixMe
50+
suppress_type=$FixMe
51+
52+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(3[0-3]\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
53+
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(3[0-3]\\|1[0-9]\\|[1-2][0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
54+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
55+
56+
unsafe.enable_getters_and_setters=true
57+
58+
[version]
59+
^0.33.0
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#Visual Studio Code
2+
#
3+
.vscode
4+
5+
# OSX
6+
#
7+
.DS_Store
8+
9+
# Xcode
10+
#
11+
build/
12+
*.pbxuser
13+
!default.pbxuser
14+
*.mode1v3
15+
!default.mode1v3
16+
*.mode2v3
17+
!default.mode2v3
18+
*.perspectivev3
19+
!default.perspectivev3
20+
xcuserdata
21+
*.xccheckout
22+
*.moved-aside
23+
DerivedData
24+
*.hmap
25+
*.ipa
26+
*.xcuserstate
27+
project.xcworkspace
28+
29+
# Android/IJ
30+
#
31+
*.iml
32+
.idea
33+
.gradle
34+
local.properties
35+
36+
# node.js
37+
#
38+
node_modules/
39+
npm-debug.log
40+
41+
# BUCK
42+
buck-out/
43+
\.buckd/
44+
android/app/libs
45+
*.keystore
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2016 yanbo
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# 简介
2+
3+
RNPolymerPo 是一个基于 [React Native](https://github.com/facebook/react-native) 的生活类聚合实战项目,目前由于没有 MAC 设备,所以没有适配 iOS,感兴趣的可以自行适配 app 目录下相关 JS 代码即可。
4+
5+
<div>
6+
<div style="display:inline;"><img src="doc/home_page.png" width="332"></div>
7+
<div style="display:inline;"><img src="doc/weixin_page.png" width="332"></div>
8+
</div>
9+
<div>
10+
<div style="display:inline;"><img src="doc/mine_page.png" width="332"></div>
11+
<div style="display:inline;"><img src="doc/online_news_page.png" width="332"></div>
12+
</div>
13+
<div>
14+
<div style="display:inline;"><img src="doc/chart_page.png" width="332"></div>
15+
<div style="display:inline;"><img src="doc/movie_page.png" width="332"></div>
16+
</div>
17+
18+
# 获取代码与编译调试打包
19+
20+
如下所有步骤及说明均为 React Native Android 的 DIY,涉及命令均为 Ubuntu 环境,Windows 类推即可。
21+
22+
## 1. 获取代码及模块安装和签名配置
23+
24+
执行如下命令进行代码下载及模块安装:
25+
26+
```unix
27+
$ git clone https://github.com/yanbober/RNPolymerPo.git
28+
$ cd RNPolymerPo
29+
$ npm install //如果觉得慢可以先切换到国内 npm 镜像源再执行此命令
30+
```
31+
32+
配置 Gradle 个人签名路径及属性:
33+
34+
```unix
35+
//1. 把你个人的签名 my-release-key.keystore 文件(不知道如何生成请自行搜索)放到 RNPolymerPo 工程的 android/app 文件夹下。
36+
//2. 编辑工程的 gradle.properties 文件,添加如下的代码(注意把其中的****替换为你自己相应密码)。
37+
38+
MYAPP_RELEASE_STORE_FILE=my-release-key.keystore
39+
MYAPP_RELEASE_KEY_ALIAS=my-key-alias
40+
MYAPP_RELEASE_STORE_PASSWORD=*****
41+
MYAPP_RELEASE_KEY_PASSWORD=*****
42+
```
43+
44+
## 2. 编译打包 APK 文件
45+
46+
编译生成在线快速调试 Debug 开发包,执行如下命令:
47+
48+
```unix
49+
$ adb reverse tcp:8081 tcp:8081
50+
$ react-native start //开启本地 JS 服务
51+
$ react-native run-android //新终端的 RNPolymerPo 目录下执行
52+
```
53+
54+
编译生成 release 包,执行如下命令:
55+
56+
```unix
57+
$ cd android && ./gradlew assembleRelease
58+
```
59+
60+
# 拓展规划
61+
62+
下一个版本准备做的事情:
63+
64+
1. 兼容性处理;
65+
2. 夜间模式;
66+
3. 热修复及 PHP 服务端编写;
67+
4. 多语言切换等问题评估;
68+
69+
# 致谢
70+
71+
- 感谢[聚合数据平台](https://www.juhe.cn/)提供的免费 API 供开发者学习调用。
72+
- 感谢[天行数据平台](http://www.tianapi.com/)提供的免费 API 供开发者学习调用。
73+
- 感谢该项目 package.json 文件中 dependencies 所用到的所有第三方开源组件。
74+
- 感谢西安点测网络科技有限公司[蒲公英应用内测专家平台](https://www.pgyer.com/)提供的 APP 监测及内测分发便利。
Lines changed: 66 additions & 0 deletions
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.rnpolymerpo',
50+
)
51+
52+
android_resource(
53+
name = 'res',
54+
res = 'src/main/res',
55+
package = 'com.rnpolymerpo',
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)