Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 2 additions & 1 deletion configs/jsactions/rollup-plugin-bigjs-import-replacer.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ export function bigJsImportReplacer() {
const [filename] = Object.keys(bundle);
const fileInfo = bundle[filename];

fileInfo.code = fileInfo.code.replace("import { Big } from 'big.js';", `import { Big } from "big.js";`);
// Remove Big import entirely - mxbuild will add it in the header at line 8
fileInfo.code = fileInfo.code.replace(/^import\s*\{\s*Big\s*\}\s*from\s*['"]big\.js['"];?\s*\r?\n/m, "");
}
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import notifee, {
Notification,
AlarmType
} from "react-native-notify-kit";

// BEGIN EXTRA CODE
// END EXTRA CODE

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,9 @@
import { Big } from "big.js";

// BEGIN EXTRA CODE
// END EXTRA CODE

type DistanceUnit = "KILOMETER" | "STATUTE_MILE" | "NAUTICAL_MILE";

// BEGIN EXTRA CODE

function deg2rad(deg: Big): Big {
return deg.times(Math.PI / 180);
}
Expand Down
14 changes: 9 additions & 5 deletions scripts/automation/mxbuild.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ FROM mcr.microsoft.com/dotnet/runtime:8.0
ARG MENDIX_VERSION

RUN \
echo "Installing Java..." && \
echo "Installing Java 21..." && \
apt-get -qq update && \
apt-get -qq install -y wget libgdiplus && \
wget -q https://download.java.net/java/GA/jdk11/9/GPL/openjdk-11.0.2_linux-x64_bin.tar.gz -O /tmp/openjdk.tar.gz && \
mkdir /usr/lib/jvm && \
wget -q https://download.oracle.com/java/21/latest/jdk-21_linux-x64_bin.tar.gz -O /tmp/openjdk.tar.gz && \
mkdir -p /usr/lib/jvm && \
tar xfz /tmp/openjdk.tar.gz --directory /usr/lib/jvm && \
ls /usr/lib/jvm && \
mv /usr/lib/jvm/jdk-21* /usr/lib/jvm/java-21-openjdk && \
rm /tmp/openjdk.tar.gz
RUN \
echo "Downloading mxbuild ${MENDIX_VERSION}..." && \
Expand All @@ -20,9 +22,11 @@ RUN \
apt-get clean
RUN \
echo "#!/bin/bash -x" >/bin/mxbuild && \
echo "dotnet /tmp/mxbuild/modeler/mxbuild.dll --java-home=/usr/lib/jvm/jdk-11.0.2 --java-exe-path=/usr/lib/jvm/jdk-11.0.2/bin/java \$@" >>/bin/mxbuild && \
echo "dotnet /tmp/mxbuild/modeler/mxbuild.dll --java-home=/usr/lib/jvm/java-21-openjdk --java-exe-path=/usr/lib/jvm/java-21-openjdk/bin/java \$@" >>/bin/mxbuild && \
chmod +x /bin/mxbuild
RUN \
echo "#!/bin/bash -x" >/bin/mx && \
echo "dotnet /tmp/mxbuild/modeler/mx.dll \$@" >>/bin/mx && \
chmod +x /bin/mx
chmod +x /bin/mx

ENV M2EE_TOOLS_JAR=/tmp/mxbuild/modeler/tools/m2ee-tools.jar
7 changes: 5 additions & 2 deletions scripts/release/module-automation/commons.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,14 @@ async function createModuleMpkInDocker(sourceDir, moduleName, mendixVersion, exc
);
}

// Build testProject via mxbuild
// Build testProject and regenerate JS actions
// 1. mx update-widgets: Updates widget files
// 2. mxbuild --target=package: Regenerates JS action files in Studio Pro format (prevents phantom diffs)
// 3. mx create-module-package: Packages the module with the regenerated files
const projectFile = basename((await getFiles(sourceDir, [`.mpr`]))[0]);
await execShellCommand(
`docker run -t -v ${sourceDir}:/source ` +
`--rm mxbuild:${mendixVersion} bash -c "mx update-widgets --loose-version-check /source/${projectFile} && dotnet /tmp/mxbuild/modeler/mx.dll create-module-package ${
`--rm mxbuild:${mendixVersion} bash -c "mx update-widgets --loose-version-check /source/${projectFile} && mxbuild --target=package /source/${projectFile} && dotnet /tmp/mxbuild/modeler/mx.dll create-module-package ${
excludeFilesRegExp ? `--exclude-files='${excludeFilesRegExp}'` : ""
} /source/${projectFile} ${moduleName}"`
);
Expand Down
Loading