Update camera screens, configuration, and build setup
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
const { withAppBuildGradle } = require('@expo/config-plugins');
|
||||
|
||||
const withLocalAars = (config) => {
|
||||
return withAppBuildGradle(config, (config) => {
|
||||
let contents = config.modResults.contents;
|
||||
|
||||
// Inject the local AAR files into dependencies block
|
||||
const dependencyBlock = `
|
||||
// Added by withLocalAars plugin
|
||||
implementation files("../../modules/usb-camera/android/libs/immersionbar-3.0.0.aar")
|
||||
implementation files("../../modules/usb-camera/android/libs/webpdecoder-1.6.4.9.0.aar")
|
||||
`;
|
||||
|
||||
if (!contents.includes('immersionbar-3.0.0.aar')) {
|
||||
contents = contents.replace(
|
||||
/dependencies\s*\{/,
|
||||
`dependencies {${dependencyBlock}`
|
||||
);
|
||||
}
|
||||
|
||||
config.modResults.contents = contents;
|
||||
return config;
|
||||
});
|
||||
};
|
||||
|
||||
module.exports = withLocalAars;
|
||||
@@ -1,44 +0,0 @@
|
||||
const { withProjectBuildGradle, withSettingsGradle } = require('@expo/config-plugins');
|
||||
|
||||
const withSettingsRepositories = (config) => {
|
||||
// 1. Modify settings.gradle (settings-level repositories)
|
||||
config = withSettingsGradle(config, (config) => {
|
||||
let contents = config.modResults.contents;
|
||||
const reposBlock = `
|
||||
// Added by withSettingsRepositories plugin
|
||||
dependencyResolutionManagement {
|
||||
repositories {
|
||||
maven { url 'https://jitpack.io' }
|
||||
maven { url 'https://jcenter.bintray.com' }
|
||||
}
|
||||
}
|
||||
`;
|
||||
if (!contents.includes('https://jcenter.bintray.com')) {
|
||||
contents += reposBlock;
|
||||
}
|
||||
config.modResults.contents = contents;
|
||||
return config;
|
||||
});
|
||||
|
||||
// 2. Modify root build.gradle (project-level repositories)
|
||||
config = withProjectBuildGradle(config, (config) => {
|
||||
let contents = config.modResults.contents;
|
||||
|
||||
// Inject jcenter and jitpack into the allprojects.repositories block
|
||||
if (!contents.includes('https://jcenter.bintray.com')) {
|
||||
contents = contents.replace(
|
||||
/maven\s*\{\s*url\s*['"]https:\/\/www\.jitpack\.io['"]\s*\}/g,
|
||||
`maven { url 'https://www.jitpack.io' }
|
||||
maven { url 'https://jcenter.bintray.com' }
|
||||
maven { url 'https://jitpack.io' }`
|
||||
);
|
||||
}
|
||||
|
||||
config.modResults.contents = contents;
|
||||
return config;
|
||||
});
|
||||
|
||||
return config;
|
||||
};
|
||||
|
||||
module.exports = withSettingsRepositories;
|
||||
Reference in New Issue
Block a user