mirror of
https://github.com/expo/config-plugins.git
synced 2026-11-14 10:08:06 -10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
999cc00275 |
No files matched your search
@@ -1,3 +1,10 @@
|
|||||||
|
### @config-plugins/react-native-pdf [1.0.2](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-22)
|
||||||
|
|
||||||
|
|
||||||
|
### Other chores
|
||||||
|
|
||||||
|
* git ignore build folders ([#59](https://github.com/expo/config-plugins/issues/59)) ([d6050be](https://github.com/expo/config-plugins/commit/d6050beb2a5c68dc59287c27ec388c2002ec7904))
|
||||||
|
|
||||||
### @config-plugins/react-native-pdf [1.0.1](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-16)
|
### @config-plugins/react-native-pdf [1.0.1](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-16)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
import { ConfigPlugin } from "@expo/config-plugins";
|
||||||
|
export declare const withAndroidPackagingOptions: ConfigPlugin;
|
||||||
|
export declare function addAndroidPackagingOptions(src: string): import("@expo/config-plugins/build/utils/generateCode").MergeResults;
|
||||||
|
declare const _default: ConfigPlugin<void>;
|
||||||
|
export default _default;
|
||||||
+52
@@ -0,0 +1,52 @@
|
|||||||
|
"use strict";
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.addAndroidPackagingOptions = exports.withAndroidPackagingOptions = void 0;
|
||||||
|
const config_plugins_1 = require("@expo/config-plugins");
|
||||||
|
const generateCode_1 = require("@expo/config-plugins/build/utils/generateCode");
|
||||||
|
let pkg = {
|
||||||
|
name: "react-native-pdf",
|
||||||
|
};
|
||||||
|
try {
|
||||||
|
pkg = require("react-native-pdf/package.json");
|
||||||
|
}
|
||||||
|
catch (_a) {
|
||||||
|
// empty catch block
|
||||||
|
}
|
||||||
|
const withAndroidPackagingOptions = (config) => {
|
||||||
|
return config_plugins_1.withAppBuildGradle(config, (config) => {
|
||||||
|
if (config.modResults.language === "groovy") {
|
||||||
|
config.modResults.contents = addAndroidPackagingOptions(config.modResults.contents).contents;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
config_plugins_1.WarningAggregator.addWarningAndroid("@config-plugins/react-native-pdf", `Cannot automatically configure app build.gradle if it's not groovy`);
|
||||||
|
}
|
||||||
|
return config;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
exports.withAndroidPackagingOptions = withAndroidPackagingOptions;
|
||||||
|
function addAndroidPackagingOptions(src) {
|
||||||
|
return generateCode_1.mergeContents({
|
||||||
|
tag: "react-native-pdf-packaging-options",
|
||||||
|
src,
|
||||||
|
newSrc: packagingOptionsContents,
|
||||||
|
anchor: /android(?:\s+)?\{/,
|
||||||
|
// Inside the android block.
|
||||||
|
offset: 1,
|
||||||
|
comment: "//",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
exports.addAndroidPackagingOptions = addAndroidPackagingOptions;
|
||||||
|
const packagingOptionsContents = `
|
||||||
|
packagingOptions {
|
||||||
|
pickFirst 'lib/x86/libc++_shared.so'
|
||||||
|
pickFirst 'lib/x86_64/libjsc.so'
|
||||||
|
pickFirst 'lib/arm64-v8a/libjsc.so'
|
||||||
|
pickFirst 'lib/arm64-v8a/libc++_shared.so'
|
||||||
|
pickFirst 'lib/x86_64/libc++_shared.so'
|
||||||
|
pickFirst 'lib/armeabi-v7a/libc++_shared.so'
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
const withReactNativePdf = (config) => {
|
||||||
|
return exports.withAndroidPackagingOptions(config);
|
||||||
|
};
|
||||||
|
exports.default = config_plugins_1.createRunOncePlugin(withReactNativePdf, pkg.name, pkg.version);
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@config-plugins/react-native-pdf",
|
"name": "@config-plugins/react-native-pdf",
|
||||||
"version": "1.0.1",
|
"version": "1.0.2",
|
||||||
"description": "Config plugin to auto configure react-native-pdf on prebuild",
|
"description": "Config plugin to auto configure react-native-pdf on prebuild",
|
||||||
"main": "build/withPdf.js",
|
"main": "build/withPdf.js",
|
||||||
"types": "build/withPdf.d.ts",
|
"types": "build/withPdf.d.ts",
|
||||||
|
|||||||
Reference in new issue
Block a user