Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/plenty-camels-pay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@callstack/react-native-brownfield': patch
---

fix: duplicated JNI libs on cold publish
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
expo56: ${{ steps.filter.outputs.expo56 }}
androidapp: ${{ steps.filter.outputs.androidapp }}
appleapp: ${{ steps.filter.outputs.appleapp }}
gradle-plugins: ${{ steps.filter.outputs.gradle-plugins }}
ci: ${{ steps.filter.outputs.ci }}
steps:
- name: Checkout
Expand All @@ -52,6 +53,8 @@ jobs:
appleapp:
- 'apps/AppleApp/**'
- 'apps/brownfield-example-shared-tests/**'
gradle-plugins:
- 'gradle-plugins/**'
ci:
- '.github/**'

Expand Down Expand Up @@ -139,6 +142,7 @@ jobs:
needs.filter.outputs.expo56 == 'true' ||
needs.filter.outputs.androidapp == 'true' ||
needs.filter.outputs.packages == 'true' ||
needs.filter.outputs.gradle-plugins == 'true' ||
needs.filter.outputs.ci == 'true'
) &&
(needs.build-lint.result == 'success' || needs.build-lint.result == 'skipped')
Expand Down Expand Up @@ -169,6 +173,7 @@ jobs:
needs.filter.outputs.rnapp == 'true' ||
needs.filter.outputs.androidapp == 'true' ||
needs.filter.outputs.packages == 'true' ||
needs.filter.outputs.gradle-plugins == 'true' ||
needs.filter.outputs.ci == 'true'
) &&
(needs.build-lint.result == 'success' || needs.build-lint.result == 'skipped')
Expand Down
2 changes: 1 addition & 1 deletion apps/RNApp/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ buildscript {
classpath("com.android.tools.build:gradle")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
classpath("com.callstack.react:brownfield-gradle-plugin:2.0.0-alpha04-SNAPSHOT")
classpath("com.callstack.react:brownfield-gradle-plugin:2.0.0-alpha05-SNAPSHOT")
}
}

Expand Down
2 changes: 1 addition & 1 deletion apps/scripts/prepare-android-build-gradle-for-ci.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if (!projectDirName) {

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const SNAPSHOT_VERSION = '2.0.0-alpha04-SNAPSHOT';
const SNAPSHOT_VERSION = '2.0.0-alpha05-SNAPSHOT';
const targetPath = path.resolve(
__dirname,
'..',
Expand Down
2 changes: 1 addition & 1 deletion gradle-plugins/react/brownfield/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PROJECT_ID=com.callstack.react.brownfield
ARTIFACT_ID=brownfield-gradle-plugin
VERSION=2.0.0-alpha04
VERSION=2.0.0-alpha05
GROUP=com.callstack.react
IMPLEMENTATION_CLASS=com.callstack.react.brownfield.plugin.RNBrownfieldPlugin

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,14 @@ object RNSourceSets {
val appBuildDir = getAppBuildDir()
sourceSet.assets.srcDirs(bundlePathSegments.map { "$appBuildDir/generated/assets/$it" })
sourceSet.res.srcDirs(bundlePathSegments.map { "$appBuildDir/generated/res/$it" })
sourceSet.jniLibs.srcDirs("libs${variantName.capitalized()}")
if (extension.useStrippedSoFiles) {
val capitalizedVariantName = variantName.capitalized()
val libsDir = project.layout.projectDirectory.dir("libs$capitalizedVariantName")
val copyTaskName = "copy${capitalizedVariantName}LibSources"
sourceSet.jniLibs.srcDir(
project.files(libsDir).builtBy(copyTaskName),
)
}
if (Utils.hasExpoUpdates(appProject, variant.name)) {
val updateResourcesTask = appProject.tasks.named(updateResourcesPathSegment)
sourceSet.assets.srcDir(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,9 @@ class JNILibsProcessor(val project: Project) {
}

val androidExtension = project.extensions.getByName("android") as LibraryExtension
val copyTask = copySoLibsTask(variantName)
copySoLibsTask(variantName)

mergeJniLibsTask.configure {
it.dependsOn(copyTask)

it.doFirst {
val projectExt = project.extensions.getByType(Extension::class.java)
val existingJNILibs =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('gradleHelpers', () => {
}`;

expect(modifyRootBuildGradle(contents)).toContain(
'classpath("com.callstack.react:brownfield-gradle-plugin:2.0.0-alpha04")'
'classpath("com.callstack.react:brownfield-gradle-plugin:2.0.0-alpha05")'
);
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export const BROWNFIELD_PLUGIN_VERSION = '2.0.0-alpha04';
export const BROWNFIELD_PLUGIN_VERSION = '2.0.0-alpha05';
export const brownfieldGradlePluginDependency = `classpath("com.callstack.react:brownfield-gradle-plugin:${BROWNFIELD_PLUGIN_VERSION}")`;
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ test('supports prerelease versions when finding the previous plugin tag', () =>
const previousTag = findPreviousPluginTag(
[
'brownfield-gradle-plugin/v2.0.0-alpha01',
'brownfield-gradle-plugin/v2.0.0-alpha04',
'brownfield-gradle-plugin/v2.0.0-alpha05',
'brownfield-gradle-plugin/v2.0.0-beta01',
'brownfield-gradle-plugin/v2.0.0',
],
'2.0.0-beta01'
);

assert.equal(previousTag, 'brownfield-gradle-plugin/v2.0.0-alpha04');
assert.equal(previousTag, 'brownfield-gradle-plugin/v2.0.0-alpha05');
});

test('treats a stable release as newer than its prereleases', () => {
Expand Down
Loading