Skip to content

Commit 1135847

Browse files
committed
make ios project work on rn61
1 parent 5ea86bf commit 1135847

File tree

81 files changed

+5489
-2811
lines changed

Some content is hidden

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

81 files changed

+5489
-2811
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -145,3 +145,5 @@ xcuserdata
145145
# Webstorm
146146
#
147147
.idea
148+
149+
example/ios/Pods/
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
require 'json'
2+
3+
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
4+
5+
Pod::Spec.new do |s|
6+
s.name = "ReactNativeKeyboardTrackingViewLib"
7+
s.version = package['version']
8+
s.summary = "React Native Keyboard Tracking View"
9+
10+
s.authors = "Wix.com"
11+
s.homepage = package['homepage']
12+
s.license = package['license']
13+
s.platforms = { :ios => "9.0", :tvos => "9.2" }
14+
15+
s.module_name = 'ReactNativeKeyboardTrackingViewLib'
16+
17+
s.source = { :git => "https://github.com/wix/react-native-keyboard-tracking-view", :tag => "#{s.version}" }
18+
s.source_files = "lib/**/*.{h,m}"
19+
20+
s.dependency 'React'
21+
s.frameworks = 'UIKit'
22+
end
File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
apply plugin: "com.android.application"
2+
3+
import com.android.build.OutputFile
4+
5+
/**
6+
* The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
7+
* and bundleReleaseJsAndAssets).
8+
* These basically call `react-native bundle` with the correct arguments during the Android build
9+
* cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
10+
* bundle directly from the development server. Below you can see all the possible configurations
11+
* and their defaults. If you decide to add a configuration block, make sure to add it before the
12+
* `apply from: "../../node_modules/react-native/react.gradle"` line.
13+
*
14+
* project.ext.react = [
15+
* // the name of the generated asset file containing your JS bundle
16+
* bundleAssetName: "index.android.bundle",
17+
*
18+
* // the entry file for bundle generation
19+
* entryFile: "index.android.js",
20+
*
21+
* // whether to bundle JS and assets in debug mode
22+
* bundleInDebug: false,
23+
*
24+
* // whether to bundle JS and assets in release mode
25+
* bundleInRelease: true,
26+
*
27+
* // whether to bundle JS and assets in another build variant (if configured).
28+
* // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
29+
* // The configuration property can be in the following formats
30+
* // 'bundleIn${productFlavor}${buildType}'
31+
* // 'bundleIn${buildType}'
32+
* // bundleInFreeDebug: true,
33+
* // bundleInPaidRelease: true,
34+
* // bundleInBeta: true,
35+
*
36+
* // whether to disable dev mode in custom build variants (by default only disabled in release)
37+
* // for example: to disable dev mode in the staging build type (if configured)
38+
* devDisabledInStaging: true,
39+
* // The configuration property can be in the following formats
40+
* // 'devDisabledIn${productFlavor}${buildType}'
41+
* // 'devDisabledIn${buildType}'
42+
*
43+
* // the root of your project, i.e. where "package.json" lives
44+
* root: "../../",
45+
*
46+
* // where to put the JS bundle asset in debug mode
47+
* jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
48+
*
49+
* // where to put the JS bundle asset in release mode
50+
* jsBundleDirRelease: "$buildDir/intermediates/assets/release",
51+
*
52+
* // where to put drawable resources / React Native assets, e.g. the ones you use via
53+
* // require('./image.png')), in debug mode
54+
* resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
55+
*
56+
* // where to put drawable resources / React Native assets, e.g. the ones you use via
57+
* // require('./image.png')), in release mode
58+
* resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
59+
*
60+
* // by default the gradle tasks are skipped if none of the JS files or assets change; this means
61+
* // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
62+
* // date; if you have any other folders that you want to ignore for performance reasons (gradle
63+
* // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
64+
* // for example, you might want to remove it from here.
65+
* inputExcludes: ["android/**", "ios/**"],
66+
*
67+
* // override which node gets called and with what additional arguments
68+
* nodeExecutableAndArgs: ["node"],
69+
*
70+
* // supply additional arguments to the packager
71+
* extraPackagerArgs: []
72+
* ]
73+
*/
74+
75+
project.ext.react = [
76+
entryFile: "index.js"
77+
]
78+
79+
apply from: "../../node_modules/react-native/react.gradle"
80+
81+
/**
82+
* Set this to true to create two separate APKs instead of one:
83+
* - An APK that only works on ARM devices
84+
* - An APK that only works on x86 devices
85+
* The advantage is the size of the APK is reduced by about 4MB.
86+
* Upload all the APKs to the Play Store and people will download
87+
* the correct one based on the CPU architecture of their device.
88+
*/
89+
def enableSeparateBuildPerCPUArchitecture = false
90+
91+
/**
92+
* Run Proguard to shrink the Java bytecode in release builds.
93+
*/
94+
def enableProguardInReleaseBuilds = false
95+
96+
android {
97+
compileSdkVersion rootProject.ext.compileSdkVersion
98+
buildToolsVersion rootProject.ext.buildToolsVersion
99+
100+
defaultConfig {
101+
applicationId "com.example"
102+
minSdkVersion rootProject.ext.minSdkVersion
103+
targetSdkVersion rootProject.ext.targetSdkVersion
104+
versionCode 1
105+
versionName "1.0"
106+
ndk {
107+
abiFilters "armeabi-v7a", "x86"
108+
}
109+
}
110+
splits {
111+
abi {
112+
reset()
113+
enable enableSeparateBuildPerCPUArchitecture
114+
universalApk false // If true, also generate a universal APK
115+
include "armeabi-v7a", "x86"
116+
}
117+
}
118+
buildTypes {
119+
release {
120+
minifyEnabled enableProguardInReleaseBuilds
121+
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
122+
}
123+
}
124+
// applicationVariants are e.g. debug, release
125+
applicationVariants.all { variant ->
126+
variant.outputs.each { output ->
127+
// For each separate APK per architecture, set a unique version code as described here:
128+
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
129+
def versionCodes = ["armeabi-v7a":1, "x86":2]
130+
def abi = output.getFilter(OutputFile.ABI)
131+
if (abi != null) { // null for the universal-debug, universal-release variants
132+
output.versionCodeOverride =
133+
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
134+
}
135+
}
136+
}
137+
}
138+
139+
dependencies {
140+
implementation fileTree(dir: "libs", include: ["*.jar"])
141+
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
142+
implementation "com.facebook.react:react-native:+" // From node_modules
143+
}
144+
145+
// Run this once to be able to run the application with BUCK
146+
// puts all compile dependencies into folder libs for BUCK to use
147+
task copyDownloadableDepsToLibs(type: Copy) {
148+
from configurations.compile
149+
into 'libs'
150+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Add project specific ProGuard rules here.
2+
# By default, the flags in this file are appended to flags specified
3+
# in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
4+
# You can edit the include path and order by changing the proguardFiles
5+
# directive in build.gradle.
6+
#
7+
# For more details, see
8+
# http://developer.android.com/guide/developing/tools/proguard.html
9+
10+
# Add any project specific keep options here:
11+
12+
# If your project uses WebView with JS, uncomment the following
13+
# and specify the fully qualified class name to the JavaScript interface
14+
# class:
15+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16+
# public *;
17+
#}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="com.example">
3+
4+
<uses-permission android:name="android.permission.INTERNET" />
5+
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
6+
7+
<application
8+
android:name=".MainApplication"
9+
android:label="@string/app_name"
10+
android:icon="@mipmap/ic_launcher"
11+
android:allowBackup="false"
12+
android:theme="@style/AppTheme">
13+
<activity
14+
android:name=".MainActivity"
15+
android:label="@string/app_name"
16+
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
17+
android:windowSoftInputMode="adjustResize">
18+
<intent-filter>
19+
<action android:name="android.intent.action.MAIN" />
20+
<category android:name="android.intent.category.LAUNCHER" />
21+
</intent-filter>
22+
</activity>
23+
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
24+
</application>
25+
26+
</manifest>
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<resources>
2+
<string name="app_name">example</string>
3+
</resources>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<resources>
2+
3+
<!-- Base application theme. -->
4+
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
5+
<!-- Customize your theme here. -->
6+
</style>
7+
8+
</resources>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Top-level build file where you can add configuration options common to all sub-projects/modules.
2+
3+
buildscript {
4+
ext {
5+
buildToolsVersion = "28.0.3"
6+
minSdkVersion = 16
7+
compileSdkVersion = 28
8+
targetSdkVersion = 28
9+
supportLibVersion = "28.0.0"
10+
}
11+
repositories {
12+
jcenter()
13+
google()
14+
}
15+
dependencies {
16+
classpath 'com.android.tools.build:gradle:3.3.1'
17+
18+
// NOTE: Do not place your application dependencies here; they belong
19+
// in the individual module build.gradle files
20+
}
21+
}
22+
23+
allprojects {
24+
repositories {
25+
google()
26+
mavenLocal()
27+
jcenter()
28+
maven {
29+
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
30+
url "$rootDir/../node_modules/react-native/android"
31+
}
32+
}
33+
}
34+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Project-wide Gradle settings.
2+
3+
# IDE (e.g. Android Studio) users:
4+
# Gradle settings configured through the IDE *will override*
5+
# any settings specified in this file.
6+
7+
# For more details on how to configure your build environment visit
8+
# http://www.gradle.org/docs/current/userguide/build_environment.html
9+
10+
# Specifies the JVM arguments used for the daemon process.
11+
# The setting is particularly useful for tweaking memory settings.
12+
# Default value: -Xmx10248m -XX:MaxPermSize=256m
13+
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14+
15+
# When configured, Gradle will run in incubating parallel mode.
16+
# This option should only be used with decoupled projects. More details, visit
17+
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18+
# org.gradle.parallel=true
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
zipStoreBase=GRADLE_USER_HOME
4+
zipStorePath=wrapper/dists
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip

0 commit comments

Comments
 (0)