项目优化

This commit is contained in:
dongdayu
2018-06-14 16:18:04 +08:00
parent 7c075af13d
commit 35642a1aa8
7 changed files with 1458 additions and 41 deletions

2
.gitignore vendored
View File

@@ -42,5 +42,3 @@ local.properties
buck-out/
\.buckd/
*.keystore
yarn.lock

View File

@@ -1,21 +1,19 @@
require "json"
require 'json'
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
Pod::Spec.new do |s|
s.name = "RNWechat"
s.version = package["version"]
s.summary = "react native wechat"
s.description = package["description"]
s.license = package["license"]
s.author = { package["author"] => "g592842897@gmail.com" }
s.homepage = package["homepage"]
s.source = { :git => package["repository"]["url"], :tag => package["version"] }
s.name = 'RNWechat'
s.version = package['version']
s.summary = package['description']
s.description = package['description']
s.license = package['license']
s.author = { package['author'] => 'g592842897@gmail.com' }
s.homepage = package['homepage']
s.source = { :git => package['repository']['url'], :tag => package['version'] }
s.requires_arc = true
s.platform = :ios, "8.0"
s.source_files = "ios/**/*.{h,m}"
s.exclude_files = "ios/SDK/*"
s.dependency "WechatOpenSDK"
s.platform = :ios, '8.0'
s.source_files = 'ios/RNWechat.{h,m}', 'ios/Handler/*.{h,m}', 'ios/Helper/*.{h,m}'
s.dependency 'WechatOpenSDK'
end

View File

@@ -267,13 +267,10 @@
58B511F01A9E6C8500147676 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/Wechat",
);
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
HEADER_SEARCH_PATHS = "$(inherited)";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Wechat",
"$(PROJECT_DIR)/SDK",
);
OTHER_LDFLAGS = "-ObjC";
@@ -285,13 +282,10 @@
58B511F11A9E6C8500147676 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)/Wechat",
);
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
HEADER_SEARCH_PATHS = "$(inherited)";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Wechat",
"$(PROJECT_DIR)/SDK",
);
OTHER_LDFLAGS = "-ObjC";

View File

@@ -15,7 +15,6 @@
},
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"postinstall": "node scripts/postinstall"
},
"rnpm": {
@@ -27,6 +26,10 @@
"react-native": ">0.50.0"
},
"devDependencies": {
"babel-eslint": "^8.2.3",
"standard": "^11.0.1"
},
"standard": {
"parser": "babel-eslint"
}
}

View File

@@ -1,18 +1,22 @@
const path = require('path')
const file = require('./file')
const nodeModuleDir = path.dirname(__filename) + '/../../..'
const postinstall = () => {
const nodeModuleDir = path.dirname(__filename) + '/../../..'
const modifies = {
get reactSpec () {
const avoidDupSign = '# Dependency'
return [
nodeModuleDir + '/react-native/React.podspec',
avoidDupSign + '\n s.subspec "Dependency" do |ss|\n ss.source_files = "React/**/*.h"\n end\n\n ',
's.subspec "Core" do |ss|',
avoidDupSign
]
const modifies = {
get reactSpec () {
const avoidDupSign = '# Dependency'
return [
nodeModuleDir + '/react-native/React.podspec',
avoidDupSign + '\n s.subspec "Dependency" do |ss|\n ss.source_files = "React/**/*.h"\n end\n\n ',
's.subspec "Core" do |ss|',
avoidDupSign
]
}
}
file.fileInsert(...modifies.reactSpec)
}
file.fileInsert(...modifies.reactSpec)
postinstall()

View File

@@ -1,7 +1,21 @@
const path = require('path')
const file = require('./file')
const projectDir = path.dirname(__filename) + '/../../../..'
const postlink = () => {
const projectDir = path.dirname(__filename) + '/../../../..'
file.fileReplace(projectDir + '/android/settings.gradle', ':@yyyyu/react-native-wechat', ':react-native-wechat')
file.fileReplace(projectDir + '/android/app/build.gradle', ':@yyyyu/react-native-wechat', ':react-native-wechat')
file.fileReplace(
projectDir + '/android/settings.gradle',
':@yyyyu/react-native-wechat',
':react-native-wechat'
)
file.fileReplace(
projectDir + '/android/app/build.gradle',
':@yyyyu/react-native-wechat',
':react-native-wechat'
)
console.log('\nLink finished, hit <Enter> to continue')
}
postlink()

1406
yarn.lock Normal file

File diff suppressed because it is too large Load Diff