@imgly/camera-react-native 1.82.1 → 1.83.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -22,8 +22,27 @@ def isNewArchitectureEnabled() {
22
22
  return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
23
23
  }
24
24
 
25
+ // React Native modules are built with the host application's AGP. AGP 9 can
26
+ // supply Kotlin itself, while older AGP versions require the Kotlin Gradle
27
+ // Plugin.
28
+ def isBuiltInKotlinEnabled() {
29
+ def agpMajor = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')[0].toInteger()
30
+ if (agpMajor < 9) {
31
+ return false
32
+ }
33
+
34
+ def propertyValue = providers.gradleProperty('android.builtInKotlin').orNull
35
+ return propertyValue == null || propertyValue.toBoolean()
36
+ }
37
+
25
38
  def getKotlinVersion() {
26
- return project.plugins.findPlugin("kotlin-android")?.class?.package?.implementationVersion
39
+ def kotlinAndroidPlugin = project.plugins.findPlugin("kotlin-android")
40
+ if (kotlinAndroidPlugin) {
41
+ return kotlinAndroidPlugin.class.package.implementationVersion
42
+ }
43
+
44
+ // AGP 9 supplies Kotlin 2+ when built-in Kotlin is enabled.
45
+ return isBuiltInKotlinEnabled() ? "2.0.0" : null
27
46
  }
28
47
 
29
48
  def isKotlin2OrHigher() {
@@ -94,7 +113,9 @@ def getKotlinCompilerExtensionVersion() {
94
113
 
95
114
  apply plugin: 'com.android.library'
96
115
  apply plugin: 'com.facebook.react'
97
- apply plugin: 'org.jetbrains.kotlin.android'
116
+ if (!isBuiltInKotlinEnabled()) {
117
+ apply plugin: 'org.jetbrains.kotlin.android'
118
+ }
98
119
 
99
120
  if (isKotlin2OrHigher()) {
100
121
  try {
@@ -105,20 +126,24 @@ if (isKotlin2OrHigher()) {
105
126
  }
106
127
 
107
128
  android {
108
- compileSdkVersion safeExtGet('compileSdkVersion', 33)
129
+ compileSdkVersion safeExtGet('compileSdkVersion', 37)
109
130
  namespace "ly.img.camera.reactnative.module"
110
131
 
111
132
  defaultConfig {
112
133
  minSdk = 24
134
+ aarMetadata {
135
+ // AGP 9 defaults this to compileSdk; declare the consumer requirement separately.
136
+ minCompileSdk = 34
137
+ }
113
138
  buildConfigField("boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString())
114
139
  }
115
140
 
116
141
  sourceSets {
117
142
  main {
118
143
  if (isNewArchitectureEnabled()) {
119
- java.srcDirs += ['src/newarch']
144
+ kotlin.srcDirs += ['src/newarch']
120
145
  } else {
121
- java.srcDirs += ['src/oldarch']
146
+ kotlin.srcDirs += ['src/oldarch']
122
147
  }
123
148
  }
124
149
  }
@@ -127,7 +152,7 @@ android {
127
152
  compose true
128
153
  }
129
154
 
130
- if (!isKotlin2OrHigher()) {
155
+ if (!isKotlin2OrHigher() && !isBuiltInKotlinEnabled()) {
131
156
  def composeVersion = getKotlinCompilerExtensionVersion()
132
157
  composeOptions {
133
158
  kotlinCompilerExtensionVersion = composeVersion
@@ -141,6 +166,6 @@ repositories {
141
166
  }
142
167
 
143
168
  dependencies {
144
- api "ly.img:camera:1.82.1"
169
+ api "ly.img:camera:1.83.0-rc.1"
145
170
  implementation "com.facebook.react:react-native"
146
171
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@imgly/camera-react-native",
3
- "version": "1.82.1",
3
+ "version": "1.83.0-rc.1",
4
4
  "description": "Camera SDK for React Native - provide a versatile video camera to your users on iOS and Android.",
5
5
  "react-native": "index.js",
6
6
  "source": "index.js",