fix: default build dir should relative to source dir

This commit is contained in:
Alfi Maulana 2024-03-25 11:11:33 +07:00
parent d402eb61d6
commit 7e98dee2e2
No known key found for this signature in database
GPG Key ID: 2242A64C2A8DF5A4
2 changed files with 40 additions and 4 deletions

38
dist/index.js generated vendored
View File

@ -27685,6 +27685,35 @@ module.exports = parseParams
/******/ } /******/ }
/******/ /******/
/************************************************************************/ /************************************************************************/
/******/ /* webpack/runtime/compat get default export */
/******/ (() => {
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __nccwpck_require__.n = (module) => {
/******/ var getter = module && module.__esModule ?
/******/ () => (module['default']) :
/******/ () => (module);
/******/ __nccwpck_require__.d(getter, { a: getter });
/******/ return getter;
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __nccwpck_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__nccwpck_require__.o(definition, key) && !__nccwpck_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __nccwpck_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/******/ /* webpack/runtime/compat */ /******/ /* webpack/runtime/compat */
/******/ /******/
/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = new URL('.', import.meta.url).pathname.slice(import.meta.url.match(/^file:\/\/\/\w:/) ? 1 : 0, -1) + "/"; /******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = new URL('.', import.meta.url).pathname.slice(import.meta.url.match(/^file:\/\/\/\w:/) ? 1 : 0, -1) + "/";
@ -27735,12 +27764,17 @@ async function buildProject(inputs) {
await (0,exec.exec)("cmake", ["--build", inputs.buildDir, ...inputs.buildArgs]); await (0,exec.exec)("cmake", ["--build", inputs.buildDir, ...inputs.buildArgs]);
} }
;// CONCATENATED MODULE: external "node:path"
const external_node_path_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:path");
var external_node_path_default = /*#__PURE__*/__nccwpck_require__.n(external_node_path_namespaceObject);
;// CONCATENATED MODULE: ./src/inputs.ts ;// CONCATENATED MODULE: ./src/inputs.ts
function getInputs() { function getInputs() {
const sourceDir = (0,core.getInput)("source-dir") || ".";
return { return {
sourceDir: (0,core.getInput)("source-dir") || ".", sourceDir,
buildDir: (0,core.getInput)("build-dir") || "build", buildDir: (0,core.getInput)("build-dir") || external_node_path_default().join(sourceDir, "build"),
generator: (0,core.getInput)("generator"), generator: (0,core.getInput)("generator"),
cCompiler: (0,core.getInput)("c-compiler"), cCompiler: (0,core.getInput)("c-compiler"),
cxxCompiler: (0,core.getInput)("cxx-compiler"), cxxCompiler: (0,core.getInput)("cxx-compiler"),

View File

@ -1,4 +1,5 @@
import { getBooleanInput, getInput, getMultilineInput } from "@actions/core"; import { getBooleanInput, getInput, getMultilineInput } from "@actions/core";
import path from "node:path";
export interface Inputs { export interface Inputs {
sourceDir: string; sourceDir: string;
@ -15,9 +16,10 @@ export interface Inputs {
} }
export function getInputs(): Inputs { export function getInputs(): Inputs {
const sourceDir = getInput("source-dir") || ".";
return { return {
sourceDir: getInput("source-dir") || ".", sourceDir,
buildDir: getInput("build-dir") || "build", buildDir: getInput("build-dir") || path.join(sourceDir, "build"),
generator: getInput("generator"), generator: getInput("generator"),
cCompiler: getInput("c-compiler"), cCompiler: getInput("c-compiler"),
cxxCompiler: getInput("cxx-compiler"), cxxCompiler: getInput("cxx-compiler"),