Skip to content

Commit f11c9fa

Browse files
Minor improvements (#21)
* Mark nullable fields, rely on ext * Add kotlin gradle plugin note.
1 parent 44d82a2 commit f11c9fa

File tree

5 files changed

+23
-8
lines changed

5 files changed

+23
-8
lines changed

android/build.gradle

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,13 @@ repositories {
1010
}
1111

1212
android {
13-
compileSdkVersion 28
13+
compileSdkVersion safeExtGet('compileSdkVersion', 28)
1414

1515
defaultConfig {
16-
minSdkVersion 21
17-
targetSdkVersion 28
18-
versionCode 1
19-
versionName "1.0.0"
16+
minSdkVersion safeExtGet('minSdkVersion', 21)
17+
targetSdkVersion safeExtGet('targetSdkVersion', 28)
2018
}
19+
2120
lintOptions {
2221
abortOnError false
2322
}

docs/JAVA.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,23 @@
22

33
React Native Brownfield provides first-class support for Java.
44

5+
### Kotlin setup
6+
7+
Even though the library provides a first-class Java support, it's written in Kotlin. To compile the project with React Native Brownfield, we need to make sure that our project's `build.gradle` file contains the required Gradle plugin.
8+
9+
```java
10+
buildscript {
11+
ext {
12+
...
13+
kotlinVersion = '1.3.31'
14+
}
15+
dependencies {
16+
...
17+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
18+
}
19+
}
20+
```
21+
522
### Linking
623

724
The library is meant to work with [auto linking](https://github.com/react-native-community/cli/blob/master/docs/autolinking.md). In case you can't use this feature, please check out the following options:

example/java/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ buildscript {
1616
dependencies {
1717
classpath 'com.android.tools.build:gradle:3.4.1'
1818
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
19-
2019
}
2120
}
2221

ios/ReactNativeBrownfield.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ NS_ASSUME_NONNULL_BEGIN
99
}
1010

1111
@property (nonatomic, copy) NSString *entryFile;
12-
@property (nonatomic, copy) NSString *fallbackResource;
12+
@property (nonatomic, copy, nullable) NSString *fallbackResource;
1313
@property (nonatomic, copy) NSString *bundlePath;
1414
@property (nonatomic) RCTBridge *bridge;
1515

ios/ReactNativeViewController.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ NS_ASSUME_NONNULL_BEGIN
55
@interface ReactNativeViewController : UIViewController
66

77
@property (nonatomic, copy) NSString *moduleName;
8-
@property (nonatomic, copy) NSDictionary *initialProperties;
8+
@property (nonatomic, copy, nullable) NSDictionary *initialProperties;
99

1010
-(instancetype)initWithModuleName:(NSString *)moduleName;
1111
-(instancetype)initWithModuleName:(NSString *)moduleName andInitialProperties:(NSDictionary*)initialProperties;

0 commit comments

Comments
 (0)