Compare commits

...
Author SHA1 Message Date
semantic-release-bot 5f4e90059e chore: 1.0.2
### @config-plugins/ffmpeg-kit-react-native [1.0.2](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-22)

### Other chores

* **ffmpeg-kit-react-native:** update plugin to use `AndroidConfig.Version.withBuildScriptExtMinimumVersion` ([#60](https://github.com/expo/config-plugins/issues/60)) ([c3a375b](https://github.com/expo/config-plugins/commit/c3a375b292d6405be7b3277d10ab4f8dbb006047))
2022-03-22 18:13:34 +00:00
Thorben Primke c3a375b292 chore(ffmpeg-kit-react-native): update plugin to use AndroidConfig.Version.withBuildScriptExtMinimumVersion (#60)
Summary:
Just updates the usage of withBuildScriptExtMinimumVersion to use
AndroidConfig.Version's withBuildScriptExtMinimumVersion directly.
2022-03-22 13:10:24 -05:00
Evan Bacon 1648e8598b chore(ci): remove PR title validation action (#62) 2022-03-22 11:53:55 -05:00
semantic-release-bot e2d2b27494 chore: 2.1.0
## @config-plugins/react-native-webrtc [2.1.0](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-22)

### Features

* **react-native-webrtc:** add config mod for Android minSdkVersion 24 ([ff8b167](https://github.com/expo/config-plugins/commit/ff8b1677640a560ca98abd8a83f349b3a1ee9017))
2022-03-22 16:48:53 +00:00
Thorben Primke ff8b167764 feat(react-native-webrtc): add config mod for Android minSdkVersion 24
Summary:
react-native-webrtc requires that the Android minSdkVersion is
set to 24.
Related issue on this here and also mentioned on Daily's RN SDK
that has react-native-webrtc as a dependency.

Adds withBuildScriptExtMinimumVersion same as the ffmpeg-kit-react-native
config plugin. Maybe withBuildScriptExtMinimumVersion could be
exported in `config-plugins` package so that it could be used directly.
2022-03-22 11:44:39 -05:00
Evan Bacon eee366bebc chore(repo): add PR template (#56)
* chore(repo): add PR template

* chore: add CODEOWNERS
2022-03-18 10:28:30 -05:00
semantic-release-bot 72fa3e14ef chore: 1.2.2
### @config-plugins/detox [1.2.2](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-16)

### Bug Fixes

* **detox:** use improved xml generation ([#47](https://github.com/expo/config-plugins/issues/47)) ([6324eb0](https://github.com/expo/config-plugins/commit/6324eb041b3b4eb2318c0a1ea0297e3b7bf28f7c))
2022-03-16 21:31:07 +00:00
Maurice DoepkeandMaurice Döpke 6324eb041b fix(detox): use improved xml generation (#47)
* fix xml generation

generate xml without space or new line in the beginning

* remove indentation

* update snapshots to no indentation

* add built file

Co-authored-by: Maurice Döpke <mauricedoepkeoutlook.de>
2022-03-16 16:27:57 -05:00
21 changed files with 91 additions and 237 deletions

No files matched your search

+1
View File
@@ -0,0 +1 @@
/* @EvanBacon
+24
View File
@@ -0,0 +1,24 @@
<!--
🚨 We use semantic release (a bot publishes everything automatically)
🚨 so please use conventional commit style for the PR title:
🚨 https://www.conventionalcommits.org/en/v1.0.0/
🚨 Example: feat(detox): add new step
-->
# Why
<!--
Please describe the motivation for this PR, and link to relevant GitHub issues, forums posts, or feature requests.
-->
# How
<!--
How did you build this feature or fix this bug and why?
-->
# Test Plan
<!--
Please describe how you tested this change and how a reviewer could reproduce your test, especially if this PR does not include automated tests! If possible, please also provide terminal output and/or screenshots demonstrating your test/reproduction.
-->
-25
View File
@@ -1,25 +0,0 @@
name: PR Title
on:
pull_request:
branches:
- "*"
types:
- opened
- reopened
- edited
- synchronize
jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: aslafy-z/[email protected]
# continue-on-error: true
id: title-check
with:
success-state: PR title is valid
failure-state: "PR title does not follow the conventional commit spec: https://www.conventionalcommits.org/en/v1.0.0/"
context-name: pr-title
preset: conventional-changelog-angular@latest
env:
GITHUB_TOKEN: ${{ github.token }}
+7
View File
@@ -1,3 +1,10 @@
### @config-plugins/detox [1.2.2](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-16)
### Bug Fixes
* **detox:** use improved xml generation ([#47](https://github.com/expo/config-plugins/issues/47)) ([6324eb0](https://github.com/expo/config-plugins/commit/6324eb041b3b4eb2318c0a1ea0297e3b7bf28f7c))
### @config-plugins/detox [1.2.1](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-16) ### @config-plugins/detox [1.2.1](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-16)
+9 -6
View File
@@ -42,12 +42,15 @@ function getTemplateConfigContent(subdomains) {
} }
function getTemplateFile(subdomains) { function getTemplateFile(subdomains) {
const content = getTemplateConfigContent(subdomains); const content = getTemplateConfigContent(subdomains);
return ` /**
<?xml version="1.0" encoding="utf-8"?> * May not have new lines or spaces in the beginning.
<network-security-config> * Otherwise build fails with:
${content} * "AAPT: error: XML or text declaration not at start of entity"
</network-security-config> */
`; return `<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
${content}
</network-security-config>`;
} }
exports.getTemplateFile = getTemplateFile; exports.getTemplateFile = getTemplateFile;
/** /**
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@config-plugins/detox", "name": "@config-plugins/detox",
"version": "1.2.1", "version": "1.2.2",
"description": "Config plugin to auto configure detox on prebuild", "description": "Config plugin to auto configure detox on prebuild",
"main": "build/withDetox.js", "main": "build/withDetox.js",
"types": "build/withDetox.d.ts", "types": "build/withDetox.d.ts",
@@ -1,25 +1,21 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`getTemplateFile returns domain-config when subdomains is an array 1`] = ` exports[`getTemplateFile returns domain-config when subdomains is an array 1`] = `
" "<?xml version=\\"1.0\\" encoding=\\"utf-8\\"?>
<?xml version=\\"1.0\\" encoding=\\"utf-8\\"?> <network-security-config>
<network-security-config>
<domain-config cleartextTrafficPermitted=\\"true\\"> <domain-config cleartextTrafficPermitted=\\"true\\">
<domain includeSubdomains=\\"true\\">localhost</domain> <domain includeSubdomains=\\"true\\">localhost</domain>
</domain-config> </domain-config>
</network-security-config> </network-security-config>"
"
`; `;
exports[`getTemplateFile returns only base-config when subdomains is '*' 1`] = ` exports[`getTemplateFile returns only base-config when subdomains is '*' 1`] = `
" "<?xml version=\\"1.0\\" encoding=\\"utf-8\\"?>
<?xml version=\\"1.0\\" encoding=\\"utf-8\\"?> <network-security-config>
<network-security-config> <base-config cleartextTrafficPermitted=\\"true\\" />
<base-config cleartextTrafficPermitted=\\"true\\" /> </network-security-config>"
</network-security-config>
"
`; `;
exports[`withNetworkSecurityConfigManifest doesn't modify config if subdomains is an empty array 1`] = ` exports[`withNetworkSecurityConfigManifest doesn't modify config if subdomains is an empty array 1`] = `
@@ -29,12 +29,15 @@ function getTemplateConfigContent(subdomains: SubdomainsType) {
export function getTemplateFile(subdomains: SubdomainsType): string { export function getTemplateFile(subdomains: SubdomainsType): string {
const content = getTemplateConfigContent(subdomains); const content = getTemplateConfigContent(subdomains);
return ` /**
<?xml version="1.0" encoding="utf-8"?> * May not have new lines or spaces in the beginning.
<network-security-config> * Otherwise build fails with:
${content} * "AAPT: error: XML or text declaration not at start of entity"
</network-security-config> */
`; return `<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
${content}
</network-security-config>`;
} }
/** /**
@@ -1,3 +1,10 @@
### @config-plugins/ffmpeg-kit-react-native [1.0.2](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-22)
### Other chores
* **ffmpeg-kit-react-native:** update plugin to use `AndroidConfig.Version.withBuildScriptExtMinimumVersion` ([#60](https://github.com/expo/config-plugins/issues/60)) ([c3a375b](https://github.com/expo/config-plugins/commit/c3a375b292d6405be7b3277d10ab4f8dbb006047))
### @config-plugins/ffmpeg-kit-react-native [1.0.1](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-16) ### @config-plugins/ffmpeg-kit-react-native [1.0.1](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-16)
@@ -1,10 +0,0 @@
import { ConfigPlugin } from "@expo/config-plugins";
/** Sets a numeric version for a value in the project.gradle buildscript.ext object to be at least the provided props.minVersion, if the existing value is greater then no change will be made. */
export declare const withBuildScriptExtMinimumVersion: ConfigPlugin<{
name: string;
minVersion: number;
}>;
export declare function setMinBuildScriptExtVersion(buildGradle: string, { name, minVersion }: {
name: string;
minVersion: number;
}): string;
@@ -1,31 +0,0 @@
"use strict";
// Copied from https://github.com/expo/expo-cli/blob/main/packages/config-plugins/src/android/Version.ts
Object.defineProperty(exports, "__esModule", { value: true });
exports.setMinBuildScriptExtVersion = exports.withBuildScriptExtMinimumVersion = void 0;
const config_plugins_1 = require("@expo/config-plugins");
/** Sets a numeric version for a value in the project.gradle buildscript.ext object to be at least the provided props.minVersion, if the existing value is greater then no change will be made. */
const withBuildScriptExtMinimumVersion = (config, props) => {
return config_plugins_1.withProjectBuildGradle(config, (config) => {
if (config.modResults.language === "groovy") {
config.modResults.contents = setMinBuildScriptExtVersion(config.modResults.contents, props);
}
else {
config_plugins_1.WarningAggregator.addWarningAndroid("withBuildScriptExtVersion", `Cannot automatically configure project build.gradle if it's not groovy`);
}
return config;
});
};
exports.withBuildScriptExtMinimumVersion = withBuildScriptExtMinimumVersion;
function setMinBuildScriptExtVersion(buildGradle, { name, minVersion }) {
var _a;
const regex = new RegExp(`(${name}\\s?=\\s?)(\\d+(?:\\.\\d+)?)`);
const currentVersion = (_a = buildGradle.match(regex)) === null || _a === void 0 ? void 0 : _a[2];
if (!currentVersion) {
config_plugins_1.WarningAggregator.addWarningAndroid("withBuildScriptExtVersion", `Cannot set minimum buildscript.ext.${name} version because the property "${name}" cannot be found or does not have a numeric value.`);
// TODO: Maybe just add the property...
return buildGradle;
}
const currentVersionNum = Number(currentVersion);
return buildGradle.replace(regex, `$1${Math.max(minVersion, currentVersionNum)}`);
}
exports.setMinBuildScriptExtVersion = setMinBuildScriptExtVersion;
+1 -2
View File
@@ -2,7 +2,6 @@
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
const config_plugins_1 = require("@expo/config-plugins"); const config_plugins_1 = require("@expo/config-plugins");
const withAndroidFFMPEGPackage_1 = require("./withAndroidFFMPEGPackage"); const withAndroidFFMPEGPackage_1 = require("./withAndroidFFMPEGPackage");
const withBuildScriptExtMinimumVersion_1 = require("./withBuildScriptExtMinimumVersion");
const withCocoaPodsImport_1 = require("./withCocoaPodsImport"); const withCocoaPodsImport_1 = require("./withCocoaPodsImport");
const withIosDeploymentTarget_1 = require("./withIosDeploymentTarget"); const withIosDeploymentTarget_1 = require("./withIosDeploymentTarget");
let pkg = { let pkg = {
@@ -31,7 +30,7 @@ const withFFMPEG = (config, _props) => {
// Android // Android
// Set min SDK Version to 24. // Set min SDK Version to 24.
[ [
withBuildScriptExtMinimumVersion_1.withBuildScriptExtMinimumVersion, config_plugins_1.AndroidConfig.Version.withBuildScriptExtMinimumVersion,
{ {
name: "minSdkVersion", name: "minSdkVersion",
minVersion: 24, minVersion: 24,
@@ -1,6 +1,6 @@
{ {
"name": "@config-plugins/ffmpeg-kit-react-native", "name": "@config-plugins/ffmpeg-kit-react-native",
"version": "1.0.1", "version": "1.0.2",
"description": "Config plugin to auto configure FFMPEG on prebuild", "description": "Config plugin to auto configure FFMPEG on prebuild",
"main": "build/withFFMPEG.js", "main": "build/withFFMPEG.js",
"types": "build/withFFMPEG.d.ts", "types": "build/withFFMPEG.d.ts",
@@ -1,89 +0,0 @@
import { WarningAggregator } from "@expo/config-plugins";
import { setMinBuildScriptExtVersion } from "../withBuildScriptExtMinimumVersion";
const EXAMPLE_PROJECT_BUILD_GRADLE = `
buildscript {
ext {
buildToolsVersion = "29.0.3"
minSdkVersion = 21
compileSdkVersion = 30
targetSdkVersion = 30
oddFormat = 30.2
}
repositories {
}
dependencies {
}
}
allprojects {
repositories {
mavenLocal()
maven {
// Android JSC is installed from npm
url(new File(["node", "--print", "require.resolve('jsc-android/package.json')"].execute(null, rootDir).text.trim(), "../dist"))
}
}
}
`;
describe(setMinBuildScriptExtVersion, () => {
beforeEach(() => {
// @ts-ignore: jest
// eslint-disable-next-line import/namespace
WarningAggregator.addWarningAndroid = jest.fn();
});
it(`sets the minSdkVersion in build.gradle if minSdkVersion is given`, () => {
expect(
setMinBuildScriptExtVersion(EXAMPLE_PROJECT_BUILD_GRADLE, {
name: "minSdkVersion",
minVersion: 22,
})
).toMatch(/minSdkVersion = 22/);
expect(WarningAggregator.addWarningAndroid).not.toHaveBeenCalled();
});
it(`sets the oddFormat in build.gradle if oddFormat is given`, () => {
expect(
setMinBuildScriptExtVersion(EXAMPLE_PROJECT_BUILD_GRADLE, {
name: "oddFormat",
minVersion: 30.3,
})
).toMatch(/oddFormat = 30\.3/);
expect(WarningAggregator.addWarningAndroid).not.toHaveBeenCalled();
});
it(`does not change the compileSdkVersion in build.gradle if compileSdkVersion is lower than the existing value`, () => {
expect(
setMinBuildScriptExtVersion(EXAMPLE_PROJECT_BUILD_GRADLE, {
name: "compileSdkVersion",
minVersion: 12,
})
).toBe(EXAMPLE_PROJECT_BUILD_GRADLE);
expect(WarningAggregator.addWarningAndroid).not.toHaveBeenCalled();
});
it(`warns when it cannot find the requested value`, () => {
expect(
setMinBuildScriptExtVersion(EXAMPLE_PROJECT_BUILD_GRADLE, {
name: "foobar",
minVersion: 12,
})
).toBe(EXAMPLE_PROJECT_BUILD_GRADLE);
expect(WarningAggregator.addWarningAndroid).toBeCalledWith(
"withBuildScriptExtVersion",
'Cannot set minimum buildscript.ext.foobar version because the property "foobar" cannot be found or does not have a numeric value.'
);
});
it(`does warns when targeting a property with a string value`, () => {
expect(
setMinBuildScriptExtVersion(EXAMPLE_PROJECT_BUILD_GRADLE, {
name: "buildToolsVersion",
minVersion: 12,
})
).toBe(EXAMPLE_PROJECT_BUILD_GRADLE);
expect(WarningAggregator.addWarningAndroid).toBeCalledWith(
"withBuildScriptExtVersion",
'Cannot set minimum buildscript.ext.buildToolsVersion version because the property "buildToolsVersion" cannot be found or does not have a numeric value.'
);
});
});
@@ -1,50 +0,0 @@
// Copied from https://github.com/expo/expo-cli/blob/main/packages/config-plugins/src/android/Version.ts
import {
ConfigPlugin,
WarningAggregator,
withProjectBuildGradle,
} from "@expo/config-plugins";
/** Sets a numeric version for a value in the project.gradle buildscript.ext object to be at least the provided props.minVersion, if the existing value is greater then no change will be made. */
export const withBuildScriptExtMinimumVersion: ConfigPlugin<{
name: string;
minVersion: number;
}> = (config, props) => {
return withProjectBuildGradle(config, (config) => {
if (config.modResults.language === "groovy") {
config.modResults.contents = setMinBuildScriptExtVersion(
config.modResults.contents,
props
);
} else {
WarningAggregator.addWarningAndroid(
"withBuildScriptExtVersion",
`Cannot automatically configure project build.gradle if it's not groovy`
);
}
return config;
});
};
export function setMinBuildScriptExtVersion(
buildGradle: string,
{ name, minVersion }: { name: string; minVersion: number }
) {
const regex = new RegExp(`(${name}\\s?=\\s?)(\\d+(?:\\.\\d+)?)`);
const currentVersion = buildGradle.match(regex)?.[2];
if (!currentVersion) {
WarningAggregator.addWarningAndroid(
"withBuildScriptExtVersion",
`Cannot set minimum buildscript.ext.${name} version because the property "${name}" cannot be found or does not have a numeric value.`
);
// TODO: Maybe just add the property...
return buildGradle;
}
const currentVersionNum = Number(currentVersion);
return buildGradle.replace(
regex,
`$1${Math.max(minVersion, currentVersionNum)}`
);
}
@@ -1,11 +1,11 @@
import { import {
AndroidConfig,
ConfigPlugin, ConfigPlugin,
createRunOncePlugin, createRunOncePlugin,
withPlugins, withPlugins,
} from "@expo/config-plugins"; } from "@expo/config-plugins";
import { withAndroidFFMPEGPackage } from "./withAndroidFFMPEGPackage"; import { withAndroidFFMPEGPackage } from "./withAndroidFFMPEGPackage";
import { withBuildScriptExtMinimumVersion } from "./withBuildScriptExtMinimumVersion";
import { import {
withCocoaPodsImport, withCocoaPodsImport,
withPodfilePropertiesPackage, withPodfilePropertiesPackage,
@@ -56,7 +56,7 @@ const withFFMPEG: ConfigPlugin<void | Props> = (config, _props) => {
// Set min SDK Version to 24. // Set min SDK Version to 24.
[ [
withBuildScriptExtMinimumVersion, AndroidConfig.Version.withBuildScriptExtMinimumVersion,
{ {
name: "minSdkVersion", name: "minSdkVersion",
minVersion: 24, minVersion: 24,
@@ -1,3 +1,10 @@
## @config-plugins/react-native-webrtc [2.1.0](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-22)
### Features
* **react-native-webrtc:** add config mod for Android minSdkVersion 24 ([ff8b167](https://github.com/expo/config-plugins/commit/ff8b1677640a560ca98abd8a83f349b3a1ee9017))
### @config-plugins/react-native-webrtc [2.0.2](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-16) ### @config-plugins/react-native-webrtc [2.0.2](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-16)
+4 -1
View File
@@ -59,7 +59,10 @@ export default {
}; };
``` ```
This plugin will also disable desugaring in the Android `gradle.properties`: `android.enableDexingArtifactTransform.desugaring=false`, and disable iOS Bitcode for "Release" builds (required). ## Important Notes
- For iOS, this plugin disables Bitcodes for all builds (required).
- For Android, this plugin disables desugaring in `gradle.properties`: `android.enableDexingArtifactTransform.desugaring=false` and the [minimum deployment target is changed to `24`](https://github.com/react-native-webrtc/react-native-webrtc/issues/720#issuecomment-552374206) (from `21`) which may break other packages in your app!
## Manual Setup ## Manual Setup
+4
View File
@@ -21,6 +21,10 @@ const withWebRTC = (config, props = {}) => {
"android.permission.SYSTEM_ALERT_WINDOW", "android.permission.SYSTEM_ALERT_WINDOW",
"android.permission.WAKE_LOCK", "android.permission.WAKE_LOCK",
]); ]);
config = config_plugins_1.AndroidConfig.Version.withBuildScriptExtMinimumVersion(config, {
name: "minSdkVersion",
minVersion: 24,
});
config = withDesugaring_1.withDesugaring(config, true); config = withDesugaring_1.withDesugaring(config, true);
return config; return config;
}; };
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@config-plugins/react-native-webrtc", "name": "@config-plugins/react-native-webrtc",
"version": "2.0.2", "version": "2.1.0",
"description": "Config plugin to setup react-native-webrtc on prebuild", "description": "Config plugin to setup react-native-webrtc on prebuild",
"main": "build/withWebRTC.js", "main": "build/withWebRTC.js",
"types": "build/withWebRTC.d.ts", "types": "build/withWebRTC.d.ts",
@@ -31,7 +31,12 @@ const withWebRTC: ConfigPlugin<IOSPermissionsProps | void> = (
"android.permission.SYSTEM_ALERT_WINDOW", "android.permission.SYSTEM_ALERT_WINDOW",
"android.permission.WAKE_LOCK", "android.permission.WAKE_LOCK",
]); ]);
config = AndroidConfig.Version.withBuildScriptExtMinimumVersion(config,
{
name: "minSdkVersion",
minVersion: 24,
}
)
config = withDesugaring(config, true); config = withDesugaring(config, true);
return config; return config;