Skip to content

Commit

Permalink
Remove modifyAppBuildGradle function and related references
Browse files Browse the repository at this point in the history
- Removed the modifyAppBuildGradle function as it was not being used.
- Eliminated all references to modifyAppBuildGradle in the codebase.
- Updated withIAPAndroid to only handle withProjectBuildGradle.
- The withProjectBuildGradle function now ensures the supportLibVersion setting is properly added if it is missing.
- Streamlined the code by removing unnecessary functionality.
  • Loading branch information
hyochan committed Sep 3, 2024
1 parent 09d4adc commit ec35826
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions plugin/src/withIAP.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {
WarningAggregator,
withAppBuildGradle,
withProjectBuildGradle,
} from 'expo/config-plugins';
import {ConfigPlugin, createRunOncePlugin} from 'expo/config-plugins';
Expand All @@ -20,10 +19,6 @@ const addToBuildGradle = (
return lines.join('\n');
};

export const modifyAppBuildGradle = (buildGradle: string) => {
return buildGradle;
};

export const modifyProjectBuildGradle = (buildGradle: string) => {
const supportLibVersion = `supportLibVersion = "28.0.0"`;
if (buildGradle.includes(supportLibVersion)) {
Expand All @@ -33,15 +28,6 @@ export const modifyProjectBuildGradle = (buildGradle: string) => {
};

const withIAPAndroid: ConfigPlugin = (config) => {
// eslint-disable-next-line @typescript-eslint/no-shadow
config = withAppBuildGradle(config, (config) => {
config.modResults.contents = modifyAppBuildGradle(
config.modResults.contents,
);
return config;
});

// eslint-disable-next-line @typescript-eslint/no-shadow
config = withProjectBuildGradle(config, (config) => {
config.modResults.contents = modifyProjectBuildGradle(
config.modResults.contents,
Expand All @@ -59,7 +45,6 @@ const withIAP: ConfigPlugin<Props | undefined> = (config, props) => {
} catch (error) {
WarningAggregator.addWarningAndroid(
'expo-iap',

`There was a problem configuring expo-iap in your native Android project: ${error}`,
);
}
Expand Down

0 comments on commit ec35826

Please sign in to comment.