Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

信ぴょう性対応 #32

Merged
merged 8 commits into from
Oct 27, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
コード修正
  • Loading branch information
JangSungChul committed Sep 25, 2023
commit 1fea6067e1dcb5951357d606192616e683524d9e
15 changes: 9 additions & 6 deletions hooks/modify-root-build-gradle.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,21 @@ module.exports = function (context) {
if (fs.existsSync(gradlePath)) {
var gradleContent = fs.readFileSync(gradlePath, "utf-8");

if (!gradleContent.match(/externalNativeBuild/g)) {
var placeHolder = "android {";
var newContent = `
// C++とKotlinの連携の設定を追加
var settingsToAdd = `
android {
externalNativeBuild {
cmake {
path "src/android/cpp/CMakeLists.txt"
path "src/main/cpp/CMakeLists.txt"
}
}
}
`;

if (!gradleContent.includes("externalNativeBuild")) {
gradleContent = gradleContent.replace(
placeHolder,
placeHolder + newContent
"android {",
"android {" + settingsToAdd
);
fs.writeFileSync(gradlePath, gradleContent, "utf-8");
}
Expand Down