2021-08-16 17:33:49 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -eo pipefail
|
|
|
|
|
|
|
|
buildtools=$HOME/.electron_build_tools
|
|
|
|
gclient_root=/workspaces/gclient
|
|
|
|
buildtools_configs=/workspaces/buildtools-configs
|
|
|
|
|
|
|
|
export PATH="$PATH:$buildtools/src"
|
|
|
|
|
|
|
|
# Create the persisted buildtools config folder
|
|
|
|
mkdir -p $buildtools_configs
|
2022-11-22 20:16:15 +00:00
|
|
|
mkdir -p $gclient_root/.git-cache
|
2021-08-16 17:33:49 +00:00
|
|
|
rm -f $buildtools/configs
|
|
|
|
ln -s $buildtools_configs $buildtools/configs
|
|
|
|
|
|
|
|
# Write the gclient config if it does not already exist
|
|
|
|
if [ ! -f $gclient_root/.gclient ]; then
|
2023-07-18 20:58:26 +00:00
|
|
|
echo "Creating gclient config"
|
|
|
|
|
2021-08-16 17:56:29 +00:00
|
|
|
echo "solutions = [
|
2021-08-16 17:33:49 +00:00
|
|
|
{ \"name\" : \"src/electron\",
|
|
|
|
\"url\" : \"https://github.com/electron/electron\",
|
|
|
|
\"deps_file\" : \"DEPS\",
|
|
|
|
\"managed\" : False,
|
|
|
|
\"custom_deps\" : {
|
|
|
|
},
|
|
|
|
\"custom_vars\": {},
|
|
|
|
},
|
|
|
|
]
|
|
|
|
" >$gclient_root/.gclient
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Write the default buildtools config file if it does
|
|
|
|
# not already exist
|
|
|
|
if [ ! -f $buildtools/configs/evm.testing.json ]; then
|
2023-07-18 20:58:26 +00:00
|
|
|
echo "Creating build-tools testing config"
|
|
|
|
|
2021-08-16 17:33:49 +00:00
|
|
|
write_config() {
|
|
|
|
echo "
|
|
|
|
{
|
2023-03-31 10:20:02 +00:00
|
|
|
\"root\": \"/workspaces/gclient\",
|
|
|
|
\"remotes\": {
|
|
|
|
\"electron\": {
|
|
|
|
\"origin\": \"https://github.com/electron/electron.git\"
|
|
|
|
}
|
2023-04-20 22:41:54 +00:00
|
|
|
},
|
2021-08-16 17:33:49 +00:00
|
|
|
\"gen\": {
|
|
|
|
\"args\": [
|
|
|
|
\"import(\\\"//electron/build/args/testing.gn\\\")\",
|
2024-04-23 16:05:43 +00:00
|
|
|
\"use_remoteexec = true\"
|
2021-08-16 17:33:49 +00:00
|
|
|
],
|
|
|
|
\"out\": \"Testing\"
|
|
|
|
},
|
|
|
|
\"env\": {
|
|
|
|
\"CHROMIUM_BUILDTOOLS_PATH\": \"/workspaces/gclient/src/buildtools\",
|
|
|
|
\"GIT_CACHE_PATH\": \"/workspaces/gclient/.git-cache\"
|
|
|
|
},
|
2024-04-23 16:05:43 +00:00
|
|
|
\"\$schema\": \"file:///home/builduser/.electron_build_tools/evm-config.schema.json\",
|
|
|
|
\"configValidationLevel\": \"strict\",
|
|
|
|
\"reclient\": \"$1\",
|
|
|
|
\"goma\": \"none\",
|
|
|
|
\"preserveXcode\": 5
|
2021-08-16 17:33:49 +00:00
|
|
|
}
|
|
|
|
" >$buildtools/configs/evm.testing.json
|
|
|
|
}
|
|
|
|
|
2024-04-23 16:05:43 +00:00
|
|
|
write_config remote_exec
|
2021-08-16 17:33:49 +00:00
|
|
|
|
2024-04-23 16:05:43 +00:00
|
|
|
e use testing
|
2021-08-16 17:33:49 +00:00
|
|
|
else
|
2023-07-18 20:58:26 +00:00
|
|
|
echo "build-tools testing config already exists"
|
2021-08-16 17:33:49 +00:00
|
|
|
fi
|