Skip to content

Commit

Permalink
fix build issues
Browse files Browse the repository at this point in the history
  • Loading branch information
chrissiewasabi committed Aug 23, 2024
1 parent e714697 commit fddee9b
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 13,736 deletions.
Binary file modified .yarn/install-state.gz
Binary file not shown.
41 changes: 21 additions & 20 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
buildscript {
// Buildscript is evaluated before everything else so we can't use getExtOrDefault
def kotlin_version = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get("kotlinVersion") : project.properties["RNMovableInk_kotlinVersion"]
def kotlin_version = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get("kotlinVersion") : project.properties["RNM_kotlinVersion"]

repositories {
google()
Expand All @@ -11,8 +10,7 @@ buildscript {
}

dependencies {
classpath "com.android.tools.build:gradle:7.2.2"
// noinspection DifferentKotlinGradleVersion
classpath "com.android.tools.build:gradle:8.0.2"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand All @@ -26,15 +24,12 @@ def getExtOrDefault(name) {
}

def getExtOrIntegerDefault(name) {
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["RN" + name]).toInteger()
def value = rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["RN" + name]
return value ? value.toInteger() : null
}

def supportsNamespace() {
def parsed = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')
def major = parsed[0].toInteger()
def minor = parsed[1].toInteger()

// Namespace support was added in 7.3.0
def (major, minor) = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.split('\\.').take(2).collect { it.toInteger() }
return (major == 7 && minor >= 3) || major >= 8
}

Expand Down Expand Up @@ -64,39 +59,45 @@ android {
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
}
buildFeatures{

buildConfig = true

}
buildTypes {
release {
minifyEnabled false
}
}

lintOptions {
lint {
disable "GradleCompatible"
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_17 // Change to your desired version
targetCompatibility JavaVersion.VERSION_17 // Change to your desired version
}
kotlinOptions {
jvmTarget = '17' // Change to your desired version
}

}

repositories {
mavenCentral()
google()
mavenCentral()
maven {
url 'https://s01.oss.sonatype.org/content/repositories/snapshots/'
}
mavenLocal()
}

def kotlin_version = getExtOrDefault("kotlinVersion")

dependencies {
// For < 0.71, this will be from the local maven repo
// For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin
//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:+"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
// implementation "com.facebook.react:react-native:0.71.+"
implementation"com.facebook.react:react-android:0.75.2"
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.8.0"
implementation "com.movableink.sdk:inked:1.5.0"
}

Expand Down
8 changes: 8 additions & 0 deletions android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,11 @@ RNMovableInk_targetSdkVersion=33
RNMovableInk_compileSdkVersion=33
RNMovableInk_ndkversion=23.1.7779620
android.useAndroidX=true


kotlinVersion=1.8.0
minSdkVersion=24
targetSdkVersion=33
compileSdkVersion=33
ndkversion=23.1.7779620
useAndroidX=true
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package com.rnmovableink
import com.facebook.react.bridge.*
import com.facebook.react.bridge.Callback
import com.movableink.inked.MIClient
import com.movableink.inked.MIClient.setMIU
import com.movableink.inked.inAppMessage.MovableInAppClient

class RNMovableInkModule(reactContext: ReactApplicationContext) :
Expand Down
3 changes: 2 additions & 1 deletion example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,14 @@ dependencies {
implementation("com.facebook.react:react-android")
implementation("com.facebook.react:flipper-integration")
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.0.0")
implementation ('org.jetbrains.kotlin:kotlin-stdlib-jdk7:2.0.20')

// debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")
// debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
// exclude group:'com.squareup.okhttp3', module:'okhttp'
// }
// debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}")

if (hermesEnabled.toBoolean()) {
implementation("com.facebook.react:hermes-android")
} else {
Expand Down
3 changes: 1 addition & 2 deletions example/android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
rootProject.name = 'MovableInkExample'
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'
includeBuild('../node_modules/@react-native/gradle-plugin')
includeBuild('../../node_modules/react-native-gradle-plugin')
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,5 +154,11 @@
}
]
]
},
"dependencies": {
"@react-native-community/cli": "^14.0.1",
"@react-native-community/cli-platform-android": "^14.0.1",
"@react-native/assets-registry": "^0.75.2",
"react-native-gradle-plugin": "^0.71.19"
}
}
11 changes: 8 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@
"compilerOptions": {
"rootDir": ".",
"paths": {
"@movable/react-native-sdk": ["./src/index"]
"@movable/react-native-sdk": [
"./src/index"
]
},
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"jsx": "react",
"lib": ["esnext"],
"lib": [
"esnext"
],
"module": "esnext",
"moduleResolution": "node",
"noFallthroughCasesInSwitch": true,
Expand All @@ -24,5 +28,6 @@
"strict": true,
"target": "esnext",
"verbatimModuleSyntax": true
}
},
"extends": "expo/tsconfig.base"
}
Loading

0 comments on commit fddee9b

Please sign in to comment.