@callstack/react-native-brownfield 3.11.0 → 3.13.0
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.
- package/CHANGELOG.md +26 -0
- package/gradle-plugin/brownfield/build.gradle.kts +134 -0
- package/gradle-plugin/brownfield/config/detekt/detekt.yml +936 -0
- package/gradle-plugin/brownfield/gradle/libs.versions.toml +19 -0
- package/gradle-plugin/brownfield/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/gradle-plugin/brownfield/gradle/wrapper/gradle-wrapper.properties +7 -0
- package/gradle-plugin/brownfield/gradle.properties +14 -0
- package/gradle-plugin/brownfield/gradlew +249 -0
- package/gradle-plugin/brownfield/gradlew.bat +92 -0
- package/gradle-plugin/brownfield/settings.gradle +7 -0
- package/gradle-plugin/brownfield/src/main/kotlin/com/callstack/react/brownfield/artifacts/ArtifactsResolver.kt +132 -0
- package/gradle-plugin/brownfield/src/main/kotlin/com/callstack/react/brownfield/exceptions/NameSpaceNotFound.kt +4 -0
- package/gradle-plugin/brownfield/src/main/kotlin/com/callstack/react/brownfield/exceptions/TaskNotFound.kt +4 -0
- package/gradle-plugin/brownfield/src/main/kotlin/com/callstack/react/brownfield/expo/ExpoPublishingHelper.kt +432 -0
- package/gradle-plugin/brownfield/src/main/kotlin/com/callstack/react/brownfield/expo/utils/BrownfieldPrimitives.kt +31 -0
- package/gradle-plugin/brownfield/src/main/kotlin/com/callstack/react/brownfield/expo/utils/ExpoProjectionPrimitives.kt +22 -0
- package/gradle-plugin/brownfield/src/main/kotlin/com/callstack/react/brownfield/expo/utils/LocalMavenUtils.kt +83 -0
- package/gradle-plugin/brownfield/src/main/kotlin/com/callstack/react/brownfield/expo/utils/ReflectionUtils.kt +79 -0
- package/gradle-plugin/brownfield/src/main/kotlin/com/callstack/react/brownfield/expo/utils/VersionMediatingDependencySet.kt +100 -0
- package/gradle-plugin/brownfield/src/main/kotlin/com/callstack/react/brownfield/plugin/CustomDependencyResolver.kt +50 -0
- package/gradle-plugin/brownfield/src/main/kotlin/com/callstack/react/brownfield/plugin/ProjectConfigurations.kt +107 -0
- package/gradle-plugin/brownfield/src/main/kotlin/com/callstack/react/brownfield/plugin/RClassTransformer.kt +131 -0
- package/gradle-plugin/brownfield/src/main/kotlin/com/callstack/react/brownfield/plugin/RNBrownfieldPlugin.kt +171 -0
- package/gradle-plugin/brownfield/src/main/kotlin/com/callstack/react/brownfield/plugin/RNSourceSets.kt +149 -0
- package/gradle-plugin/brownfield/src/main/kotlin/com/callstack/react/brownfield/processors/AssetTaskProcessor.kt +29 -0
- package/gradle-plugin/brownfield/src/main/kotlin/com/callstack/react/brownfield/processors/ExplodeTaskProvider.kt +63 -0
- package/gradle-plugin/brownfield/src/main/kotlin/com/callstack/react/brownfield/processors/JNILibsProcessor.kt +165 -0
- package/gradle-plugin/brownfield/src/main/kotlin/com/callstack/react/brownfield/processors/ManifestTaskProcessor.kt +74 -0
- package/gradle-plugin/brownfield/src/main/kotlin/com/callstack/react/brownfield/processors/MergeProcessor.kt +55 -0
- package/gradle-plugin/brownfield/src/main/kotlin/com/callstack/react/brownfield/processors/ProguardProcessor.kt +61 -0
- package/gradle-plugin/brownfield/src/main/kotlin/com/callstack/react/brownfield/processors/ResourceTaskProcessor.kt +26 -0
- package/gradle-plugin/brownfield/src/main/kotlin/com/callstack/react/brownfield/processors/VariantHelper.kt +61 -0
- package/gradle-plugin/brownfield/src/main/kotlin/com/callstack/react/brownfield/processors/VariantPackagesProperty.kt +21 -0
- package/gradle-plugin/brownfield/src/main/kotlin/com/callstack/react/brownfield/processors/VariantTaskProvider.kt +103 -0
- package/gradle-plugin/brownfield/src/main/kotlin/com/callstack/react/brownfield/shared/BaseProject.kt +17 -0
- package/gradle-plugin/brownfield/src/main/kotlin/com/callstack/react/brownfield/shared/BundleTaskProvider.kt +46 -0
- package/gradle-plugin/brownfield/src/main/kotlin/com/callstack/react/brownfield/shared/Constants.kt +58 -0
- package/gradle-plugin/brownfield/src/main/kotlin/com/callstack/react/brownfield/shared/ExplodeAarTask.kt +72 -0
- package/gradle-plugin/brownfield/src/main/kotlin/com/callstack/react/brownfield/shared/GradleILogger.kt +59 -0
- package/gradle-plugin/brownfield/src/main/kotlin/com/callstack/react/brownfield/shared/Logging.kt +24 -0
- package/gradle-plugin/brownfield/src/main/kotlin/com/callstack/react/brownfield/shared/ModuleInfo.kt +22 -0
- package/gradle-plugin/brownfield/src/main/kotlin/com/callstack/react/brownfield/utils/AndroidArchiveLibrary.kt +77 -0
- package/gradle-plugin/brownfield/src/main/kotlin/com/callstack/react/brownfield/utils/DirectoryManager.kt +20 -0
- package/gradle-plugin/brownfield/src/main/kotlin/com/callstack/react/brownfield/utils/Extension.kt +44 -0
- package/gradle-plugin/brownfield/src/main/kotlin/com/callstack/react/brownfield/utils/StringExtensions.kt +5 -0
- package/gradle-plugin/brownfield/src/main/kotlin/com/callstack/react/brownfield/utils/StringMatcher.kt +21 -0
- package/gradle-plugin/brownfield/src/main/kotlin/com/callstack/react/brownfield/utils/Utils.kt +59 -0
- package/ios/Expo/ExpoHostRuntime.swift +3 -2
- package/ios/ReactNativeBrownfield.swift +1 -1
- package/ios/Vanilla/ReactNativeHostRuntime.swift +5 -2
- package/ios/swiftpm/Sources/BrownfieldBundleSupport/BrownfieldBundleURLResolver.swift +11 -5
- package/ios/swiftpm/Tests/BrownfieldBundleSupportTests/BrownfieldBundleURLResolverTests.swift +17 -5
- package/lib/commonjs/expo-config-plugin/android/utils/constants.js +1 -1
- package/lib/commonjs/expo-config-plugin/android/utils/constants.js.map +1 -1
- package/lib/commonjs/expo-config-plugin/ios/xcodeHelpers.js +2 -1
- package/lib/commonjs/expo-config-plugin/ios/xcodeHelpers.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/expo-config-plugin/android/utils/constants.js +1 -1
- package/lib/module/expo-config-plugin/android/utils/constants.js.map +1 -1
- package/lib/module/expo-config-plugin/ios/xcodeHelpers.js +2 -1
- package/lib/module/expo-config-plugin/ios/xcodeHelpers.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/commonjs/src/expo-config-plugin/android/utils/constants.d.ts +2 -2
- package/lib/typescript/commonjs/src/expo-config-plugin/android/utils/constants.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/expo-config-plugin/ios/xcodeHelpers.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/index.d.ts +1 -0
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/expo-config-plugin/android/utils/constants.d.ts +2 -2
- package/lib/typescript/module/src/expo-config-plugin/android/utils/constants.d.ts.map +1 -1
- package/lib/typescript/module/src/expo-config-plugin/ios/xcodeHelpers.d.ts.map +1 -1
- package/lib/typescript/module/src/index.d.ts +1 -0
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/package.json +6 -4
- package/scripts/sync-gradle-plugin-source.js +58 -0
- package/src/expo-config-plugin/android/utils/constants.ts +1 -1
- package/src/expo-config-plugin/ios/xcodeHelpers.ts +14 -0
- package/src/index.ts +2 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copies the Brownfield Gradle plugin source from gradle-plugins/react/brownfield/
|
|
3
|
+
* into packages/react-native-brownfield/gradle-plugin/brownfield/ so that the
|
|
4
|
+
* plugin source is included in the published npm package.
|
|
5
|
+
*
|
|
6
|
+
* This enables consumers to use the plugin as a composite build via includeBuild
|
|
7
|
+
* from node_modules instead of downloading it from Maven Central — useful for
|
|
8
|
+
* local patching or working with an unreleased version.
|
|
9
|
+
*
|
|
10
|
+
* Run with --clean to remove the copied output (e.g. after publishing or testing).
|
|
11
|
+
*
|
|
12
|
+
* Usage:
|
|
13
|
+
* node sync-gradle-plugin-source.js # copy
|
|
14
|
+
* node sync-gradle-plugin-source.js --clean # remove
|
|
15
|
+
*/
|
|
16
|
+
const fs = require('node:fs');
|
|
17
|
+
const path = require('node:path');
|
|
18
|
+
|
|
19
|
+
const packageRoot = path.resolve(__dirname, '..');
|
|
20
|
+
const repoRoot = path.resolve(packageRoot, '..', '..');
|
|
21
|
+
|
|
22
|
+
const sourceBrownfieldPath = path.join(
|
|
23
|
+
repoRoot,
|
|
24
|
+
'gradle-plugins',
|
|
25
|
+
'react',
|
|
26
|
+
'brownfield'
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
const targetRoot = path.join(packageRoot, 'gradle-plugin');
|
|
30
|
+
const targetBrownfieldPath = path.join(targetRoot, 'brownfield');
|
|
31
|
+
|
|
32
|
+
if (process.argv.includes('--clean')) {
|
|
33
|
+
// Remove the copied gradle-plugin directory from the package
|
|
34
|
+
fs.rmSync(targetRoot, { recursive: true, force: true });
|
|
35
|
+
process.exit(0);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (!fs.existsSync(sourceBrownfieldPath)) {
|
|
39
|
+
console.error(`Error: Source path not found: ${sourceBrownfieldPath}`);
|
|
40
|
+
console.error('This script must be run from within the monorepo.');
|
|
41
|
+
process.exit(1);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Always start from a clean slate to avoid stale files
|
|
45
|
+
fs.rmSync(targetRoot, { recursive: true, force: true });
|
|
46
|
+
|
|
47
|
+
fs.cpSync(sourceBrownfieldPath, targetBrownfieldPath, {
|
|
48
|
+
recursive: true,
|
|
49
|
+
// Exclude Gradle build artefacts and local state that should not be shipped
|
|
50
|
+
filter(source) {
|
|
51
|
+
const relativePath = path.relative(sourceBrownfieldPath, source);
|
|
52
|
+
const parts = relativePath.split(path.sep);
|
|
53
|
+
|
|
54
|
+
return !parts.some((part) =>
|
|
55
|
+
['build', '.gradle', 'local.properties', '.kotlin', 'bin'].includes(part)
|
|
56
|
+
);
|
|
57
|
+
},
|
|
58
|
+
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const BROWNFIELD_PLUGIN_VERSION = '
|
|
1
|
+
export const BROWNFIELD_PLUGIN_VERSION = '2.0.0-alpha01';
|
|
2
2
|
export const brownfieldGradlePluginDependency = `classpath("com.callstack.react:brownfield-gradle-plugin:${BROWNFIELD_PLUGIN_VERSION}")`;
|
|
@@ -454,10 +454,12 @@ export function rewriteBundleReactNativePhaseScriptForFrameworkTarget(
|
|
|
454
454
|
if [[ "$CONFIGURATION" = *Debug* ]]; then
|
|
455
455
|
unset SKIP_BUNDLING
|
|
456
456
|
export FORCE_BUNDLING=1
|
|
457
|
+
export EXTRA_PACKAGER_ARGS="$EXTRA_PACKAGER_ARGS --dev false"
|
|
457
458
|
fi
|
|
458
459
|
`;
|
|
459
460
|
const debugSkipBundlingBlock =
|
|
460
461
|
/if \[\[ "\$CONFIGURATION" = \*Debug\* \]\]; then\s+export SKIP_BUNDLING=1\s+fi\s*/m;
|
|
462
|
+
const forceBundlingExport = /^([ \t]*)export FORCE_BUNDLING=1[ \t]*$/m;
|
|
461
463
|
|
|
462
464
|
if (debugSkipBundlingBlock.test(shellScript)) {
|
|
463
465
|
return shellScript.replace(
|
|
@@ -467,6 +469,18 @@ fi
|
|
|
467
469
|
}
|
|
468
470
|
|
|
469
471
|
if (shellScript.includes('export FORCE_BUNDLING=1')) {
|
|
472
|
+
if (shellScript.includes('--dev false')) {
|
|
473
|
+
return shellScript;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
if (forceBundlingExport.test(shellScript)) {
|
|
477
|
+
return shellScript.replace(
|
|
478
|
+
forceBundlingExport,
|
|
479
|
+
(_, indentation: string) =>
|
|
480
|
+
`${indentation}export FORCE_BUNDLING=1\n${indentation}export EXTRA_PACKAGER_ARGS="$EXTRA_PACKAGER_ARGS --dev false"`
|
|
481
|
+
);
|
|
482
|
+
}
|
|
483
|
+
|
|
470
484
|
return shellScript;
|
|
471
485
|
}
|
|
472
486
|
|
package/src/index.ts
CHANGED