Skip to content

Commit

Permalink
Merge branch 'release/2.3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
guidotack committed Jun 25, 2019
2 parents 55e5819 + 03feb1a commit fee7337
Show file tree
Hide file tree
Showing 40 changed files with 3,881 additions and 2,547 deletions.
314 changes: 253 additions & 61 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
stages:
- build
- bundle

.win_build_template: &win_build_definition
stage: build
script:
- if not exist "build" mkdir build
- if not exist "ide" mkdir ide
- cd build
- echo set -x; export PATH=`cygpath -u %QTDIR%/bin`:$PATH; qmake "CONFIG+=bundled" "DEFINES+=MINIZINC_IDE_BUILD=\\\\\\\"\"${CI_PIPELINE_ID}\\\\\\\"\"" ../MiniZincIDE/MiniZincIDE.pro; nmake; cp release/MiniZincIDE.exe ../ide; cd ../ide; windeployqt --no-translations --no-compiler-runtime --no-system-d3d-compiler MiniZincIDE.exe > build.sh
- d2u build.sh
- bash build.sh
artifacts:
paths:
- ide/
- package

# ----------- Build MiniZincIDE -----------

build:linux:
stage: build
Expand All @@ -26,65 +14,269 @@ build:linux:
- make -j4 INSTALL_ROOT=../ide install; find ../ide/
- cd ..
- linuxdeployqt ide/usr/bin/MiniZincIDE -bundle-non-qt-libs -no-translations -no-copy-copyright-files
tags:
- linux
- docker
# Workaround for: https://github.com/probonopd/linuxdeployqt/issues/35
- "repoquery -l nss-softokn | grep lib64 | grep '.so\\|.chk' | xargs -i cp -R {} ./ide/usr/lib/"
tags: [linux, docker]
artifacts:
paths:
- ide/
cache:
key: "linux_$CI_COMMIT_REF_SLUG"
paths:
- build/
paths: [ide/]

build:osx:
stage: build
variables:
QTDIR: "$OSXQTDIR"
script:
- export PATH="$QTDIR/bin:$PATH"
- mkdir -p build; cd build
- qmake -makefile "CONFIG+=bundled" "DEFINES+=MINIZINC_IDE_BUILD=\\\\\\\"\"${CI_PIPELINE_ID}\\\\\\\"\"" ../MiniZincIDE/MiniZincIDE.pro
- make -j4
- cp -r MiniZincIDE.app ..
tags:
- osx
- cpp
- qt
tags: [osx, cpp, qt]
artifacts:
paths:
- MiniZincIDE.app
cache:
key: "osx_$CI_COMMIT_REF_SLUG"
paths:
- build/
paths: [MiniZincIDE.app]

.build:win32: #DISABLED
<<: *win_build_definition
variables:
QTDIR: "$WINQTDIR"
build:win64:
stage: build
script:
- if not exist "build" mkdir build
- if not exist "ide" mkdir ide
- cd build
- qmake "CONFIG+=bundled" "DEFINES+=MINIZINC_IDE_BUILD=\\\\\\\"\"%CI_PIPELINE_ID%\\\\\\\"\"" ../MiniZincIDE/MiniZincIDE.pro
- nmake
- cp release/MiniZincIDE.exe ../ide
- cd ../ide
- windeployqt --no-translations --no-compiler-runtime --no-system-d3d-compiler MiniZincIDE.exe
tags: [win64, cpp, qt]
artifacts:
paths: [ide/]

# ----------- MiniZinc Packaging -----------
.packaging_setup: &packaging_setup
before_script:
- call "C:\Program Files (x86)\Microsoft Visual Studio 14.0/VC/vcvarsall.bat"
tags:
- win32
- cpp
- qt
cache:
key: "win32_$CI_COMMIT_REF_SLUG"
paths:
- build/
### Set the MZNVERSION variable
- "if [ -n \"$CI_COMMIT_TAG\" ]; then MZNVERSION=\"$CI_COMMIT_TAG\"; else MZNVERSION=\"build$CI_PIPELINE_ID\"; fi"
### Choose the MiniZinc compiler branch
- "if [ -n \"$CI_COMMIT_TAG\" ]; then MZNREF=\"$CI_COMMIT_TAG\"; elif [ \"$CI_COMMIT_REF_NAME\" = \"master\" ]; then MZNREF=\"master\"; else MZNREF=\"develop\"; fi"
### Download Dependencies
- curl --silent -o minizinc.zip --location --header "PRIVATE-TOKEN:$ACCESS_TOKEN" "https://gitlab.com/api/v4/projects/minizinc%2Fminizinc/jobs/artifacts/$MZNREF/download?job=build:$MZNARCH"
- unzip -q minizinc.zip
- "[ ${DOWNLOAD_SOLVERS:-1} -eq 1 ] && curl --silent -o vendor.zip --location --header \"PRIVATE-TOKEN:$ACCESS_TOKEN\" \"https://gitlab.com/api/v4/projects/minizinc%2Fvendor/jobs/artifacts/master/download?job=bundle:$MZNARCH\" && unzip -q vendor.zip"
- "[ ${DOWNLOAD_GLOBALIZER:-0} -eq 1 ] && curl --silent -o globalizer.zip --location --header \"PRIVATE-TOKEN:$ACCESS_TOKEN\" \"https://gitlab.com/api/v4/projects/minizinc%2FGlobalizer/jobs/artifacts/master/download?job=build:$MZNARCH\" && unzip -q globalizer.zip"
- "[ ${DOWNLOAD_FINDMUS:-0} -eq 1 ] && curl --silent -o findmus.zip --location --header \"PRIVATE-TOKEN:$ACCESS_TOKEN\" \"https://gitlab.com/api/v4/projects/minizinc%2FFindMUS/jobs/artifacts/master/download?job=build:$MZNARCH\" && unzip -q findmus.zip"

build:win64:
<<: *win_build_definition
package:linux:
stage: package
image: dekker1/minibuild:package
variables:
MZNARCH: "linux"
DOWNLOAD_GLOBALIZER: 1
DOWNLOAD_FINDMUS: 1
<<: *packaging_setup
script:
- PACKAGE=MiniZincIDE-${MZNVERSION}-bundle-linux
- mkdir -p $PACKAGE/
### Package IDE
- mv ide/usr/* $PACKAGE/
- cp resources/scripts/MiniZincIDE.sh $PACKAGE/
### Package MiniZinc
- mv minizinc/bin/* $PACKAGE/bin/
- mv minizinc/share $PACKAGE/share
### Package vendor solvers
- mv vendor/gecode/bin/fzn-gecode $PACKAGE/bin/
- mv vendor/gecode/share/gecode/mznlib $PACKAGE/share/minizinc/gecode
- mv vendor/chuffed/bin/fzn-chuffed $PACKAGE/bin/
- mv vendor/chuffed/share/chuffed/mznlib $PACKAGE/share/minizinc/chuffed
### Package Globalizer
- mv globalizer/bin/minizinc-globalizer $PACKAGE/bin/
- mv globalizer/share/globalizer/mznlib $PACKAGE/share/minizinc/globalizer
### Package findMUS
- mv findMUS/bin/findMUS $PACKAGE/bin/
### Package solver scripts
- cp resources/scripts/fzn-gecode-gist $PACKAGE/bin/
### Package default settings
- mkdir -p $PACKAGE/share/minizinc/solvers/
- cp resources/solvers/*.msc $PACKAGE/share/minizinc/solvers/
- cp resources/Preferences.json $PACKAGE/share/minizinc/
### Strip included binaries
- (cd $PACKAGE/bin; strip minizinc fzn-gecode fzn-chuffed findMUS minizinc-globalizer mzn2doc)
- cp resources/misc/README $PACKAGE
### Compress package
- tar -czf $PACKAGE.tgz $PACKAGE
### Generate checksum
- sha256sum $PACKAGE.tgz > $PACKAGE.sha256
artifacts:
name: "minizinc_bundle_linux_${CI_PIPELINE_ID}"
paths: [MiniZincIDE*.tgz, MiniZincIDE*.sha256]
dependencies: ["build:linux"]
tags: [linux, docker]

package:osx:
stage: package
variables:
MZNARCH: "osx"
DOWNLOAD_GLOBALIZER: 1
DOWNLOAD_FINDMUS: 1
<<: *packaging_setup
script:
- "DIR=MiniZincIDE.app/Contents/Resources; MZNDIR=$DIR/share/minizinc"
- mkdir -p $MZNDIR/solvers
### Package MiniZinc
- mv minizinc/bin/* $DIR/
- mv minizinc/share/minizinc/* $MZNDIR/
### Package vendor solvers
- mkdir -p $DIR/bin/
- mv vendor/gecode/bin/fzn-gecode $DIR/bin/
- (cd $DIR; ln -s gecode/fzn-gecode)
- mv vendor/gecode/share/gecode/mznlib $MZNDIR/gecode
- mv vendor/chuffed/bin/fzn-chuffed $DIR/bin/
- mv vendor/chuffed/share/chuffed/mznlib $MZNDIR/chuffed
### Package Globalizer
- mv globalizer/bin/minizinc-globalizer $DIR/bin/
- mv globalizer/share/globalizer/mznlib $MZNDIR/globalizer
### Package findMUS
- mv findMUS/bin/findMUS $DIR/bin/
### Package solver scripts
- cp resources/scripts/fzn-gecode-gist $DIR/bin/
### Package default settings
- cp resources/solvers/*.msc $MZNDIR/solvers
- cp resources/Preferences.json $MZNDIR/
### Run automated Qt deployment tool
- macdeployqt ./MiniZincIDE.app -executable=$DIR/bin/fzn-gecode
artifacts:
name: "minizinc_bundle_mac_${CI_PIPELINE_ID}"
paths: [MiniZincIDE.app]
dependencies: ["build:osx"]
tags: [osx, qt]

package:win64:
stage: package
variables:
QTDIR: "$WINQTDIR"
MZNARCH: "win64"
MSVCREDIST: "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Redist/MSVC/14.16.27012/x64/Microsoft.VC141.CRT"
UCRTREDIST: "C:/Program Files (x86)/Windows Kits/10/Redist/ucrt/DLLs/x64"
ISSARCH: "x64"
ISSARCHALLOWED: "x64"
before_script:
- call "C:\Program Files (x86)\Microsoft Visual Studio 14.0/VC/vcvarsall.bat" amd64
tags:
- win64
- cpp
- qt
cache:
key: "win64_$CI_COMMIT_REF_SLUG"
paths:
- build/
### Set the MZNVERSION variable
- if defined CI_COMMIT_TAG (set MZNVERSION=%CI_COMMIT_TAG%) else (set MZNVERSION=%CI_PIPELINE_ID%)
### Choose the MiniZinc compiler branch
- if defined CI_COMMIT_TAG (set MZNREF=%CI_COMMIT_TAG%) else if %CI_COMMIT_REF_NAME%==master (set MZNREF=master) else (set MZNREF=develop)
### Download Dependencies
- curl --silent -o minizinc.zip --location --header "PRIVATE-TOKEN:%ACCESS_TOKEN%" "https://gitlab.com/api/v4/projects/minizinc%%2Fminizinc/jobs/artifacts/%MZNREF%/download?job=build:%MZNARCH%"
- unzip -q minizinc.zip
- curl --silent -o vendor.zip --location --header "PRIVATE-TOKEN:%ACCESS_TOKEN%" "https://gitlab.com/api/v4/projects/minizinc%%2Fvendor/jobs/artifacts/master/download?job=bundle:%MZNARCH%"
- unzip -q vendor.zip
- curl --silent -o globalizer.zip --location --header "PRIVATE-TOKEN:%ACCESS_TOKEN%" "https://gitlab.com/api/v4/projects/minizinc%%2Fglobalizer/jobs/artifacts/master/download?job=build:%MZNARCH%"
- unzip -q globalizer.zip
- curl --silent -o findmus.zip --location --header "PRIVATE-TOKEN:%ACCESS_TOKEN%" "https://gitlab.com/api/v4/projects/minizinc%%2FFindMus/jobs/artifacts/master/download?job=build:%MZNARCH%"
- unzip -q findmus.zip
script:
- "\"C:/Program Files (x86)/Inno Setup 5/ISCC.exe\" /dMyAppVersion=\"%MZNVERSION%\" /dMyMZNVersion=\"%MZNVERSION%\" /dMyAppDirectory=\"%CI_PROJECT_DIR%\" /dMyMSVCRedist=\"%MSVCREDIST%\" /dMyUCRTRedist=\"%UCRTREDIST%\" /dMyAPPArch=\"%MZNARCH%\" /dMyApp64Bit=\"%ISSARCH%\" /dMyAppArchitectures=\"%ISSARCHALLOWED%\" /O\"%CI_PROJECT_DIR%\" resources/pkg_config/minizinc-bundle.iss"
### Generate checksum
- certutil -hashfile MiniZincIDE-%MZNVERSION%-bundled-setup-%MZNARCH%.exe SHA256 > MiniZincIDE-%MZNVERSION%-bundled-setup-%MZNARCH%.sha256
artifacts:
name: "minizinc_bundle_windows_%CI_PIPELINE_ID%"
paths: [MiniZincIDE*.exe, MiniZincIDE*.sha256]
dependencies: ["build:win64"]
tags: [win64]

package:appimage:
stage: package
image: dekker1/minibuild:appimage
variables:
MZNARCH: "linux"
DOWNLOAD_GLOBALIZER: 1
DOWNLOAD_FINDMUS: 1
PACKAGE: "MiniZinc.AppDir"
<<: *packaging_setup
script:
- mkdir -p $PACKAGE/usr/
### Package IDE
- mv ide/usr/* $PACKAGE/usr/
### Package MiniZinc
- mv minizinc/bin/* $PACKAGE/usr/bin/
- mv minizinc/share $PACKAGE/usr/share
### Package vendor solvers
- mv vendor/gecode/bin/fzn-gecode $PACKAGE/usr/bin/
- mv vendor/gecode/share/gecode/mznlib $PACKAGE/usr/share/minizinc/gecode
- mv vendor/chuffed/bin/fzn-chuffed $PACKAGE/usr/bin/
- mv vendor/chuffed/share/chuffed/mznlib $PACKAGE/usr/share/minizinc/chuffed
### Package Globalizer
- mv globalizer/bin/minizinc-globalizer $PACKAGE/usr/bin/
- mv globalizer/share/globalizer/mznlib $PACKAGE/usr/share/minizinc/globalizer
### Package findMUS
- mv findMUS/bin/findMUS $PACKAGE/usr/bin/
### Package solver scripts
- cp resources/scripts/fzn-gecode-gist $PACKAGE/usr/bin/
### Package default settings
- mkdir -p $PACKAGE/usr/share/minizinc/solvers/
- cp resources/solvers/*.msc $PACKAGE/usr/share/minizinc/solvers/
- cp resources/Preferences.json $PACKAGE/usr/share/minizinc/
### Strip included binaries
- (cd $PACKAGE/usr/bin; strip minizinc fzn-gecode fzn-chuffed findMUS minizinc-globalizer mzn2doc)
- cp resources/misc/README $PACKAGE
### Assemble AppImage
- cp resources/scripts/AppRun $PACKAGE
- cp resources/misc/minizinc.desktop $PACKAGE/minizinc.desktop
- cp resources/icon.png $PACKAGE/minizinc.png
- ARCH=x86_64 appimagetool $PACKAGE MiniZincIDE-${MZNVERSION}-x86_64.AppImage
### Generate checksum
- sha256sum MiniZincIDE*.AppImage > MiniZincIDE-${MZNVERSION}-x86_64.sha256
artifacts:
name: "minizinc_appimage_${CI_PIPELINE_ID}"
paths: [MiniZincIDE*.AppImage, MiniZincIDE*.sha256]
dependencies: ["build:linux"]
tags: [linux, docker]

package:docker_alpine:
stage: package
variables:
MZNARCH: "musl"
<<: *packaging_setup
script:
- docker build -f resources/pkg_config/alpine.Dockerfile -t minizinc_alpine .
- if [ -n "$CI_COMMIT_TAG" ]; then docker tag minizinc_alpine minizinc/minizinc:$CI_COMMIT_TAG && docker push minizinc/minizinc:$CI_COMMIT_TAG; fi
- if [ "$CI_COMMIT_REF_NAME" = "master" ]; then docker tag minizinc_alpine minizinc/minizinc:latest && docker push minizinc/minizinc:latest; fi
- if [ "$CI_COMMIT_REF_NAME" = "develop" ]; then docker tag minizinc_alpine minizinc/minizinc:edge && docker push minizinc/minizinc:edge; fi
dependencies: []
only: [tags, master, develop]
tags: [docker-cli]

package:docker_ubuntu:
stage: package
variables:
MZNARCH: "linux"
DOWNLOAD_SOLVERS: 0
<<: *packaging_setup
script:
- curl --silent -o gecode.zip --location --header "PRIVATE-TOKEN:$ACCESS_TOKEN" "https://gitlab.com/api/v4/projects/minizinc%2Fvendor/jobs/artifacts/master/download?job=gecode:$MZNARCH"
- unzip -q gecode.zip
- curl --silent -o chuffed.zip --location --header "PRIVATE-TOKEN:$ACCESS_TOKEN" "https://gitlab.com/api/v4/projects/minizinc%2Fvendor/jobs/artifacts/master/download?job=chuffed:$MZNARCH"
- unzip -q chuffed.zip
- docker build -f resources/pkg_config/ubuntu.Dockerfile -t minizinc_ubuntu .
- if [ -n "$CI_COMMIT_TAG" ]; then docker tag minizinc_ubuntu minizinc/minizinc:ubuntu_$CI_COMMIT_TAG && docker push minizinc/minizinc:ubuntu_$CI_COMMIT_TAG; fi
- if [ "$CI_COMMIT_REF_NAME" = "master" ]; then docker tag minizinc_ubuntu minizinc/minizinc:ubuntu_latest && docker push minizinc/minizinc:ubuntu_latest; fi
- if [ "$CI_COMMIT_REF_NAME" = "develop" ]; then docker tag minizinc_ubuntu minizinc/minizinc:ubuntu_edge && docker push minizinc/minizinc:ubuntu_edge; fi
dependencies: []
only: [tags, master, develop]
tags: [docker-cli]

package:snap:
stage: package
image: dekker1/minibuild:snap
variables:
MZNARCH: "linux"
DOWNLOAD_GLOBALIZER: 1
DOWNLOAD_FINDMUS: 1
<<: *packaging_setup
script:
- strip minizinc/bin/minizinc vendor/gecode/bin/fzn-gecode vendor/chuffed/bin/fzn-chuffed findMUS/bin/findMUS globalizer/bin/minizinc-globalizer minizinc/bin/mzn2doc
- cp resources/pkg_config/snapcraft.yaml .
- echo "$MZNVERSION" > version.txt
- apt-get update -y
- snapcraft
- echo "$SNAPLOGIN" > login.pass
- snapcraft login --with login.pass
- snapcraft push --release=edge minizinc*.snap
artifacts:
name: "minizinc_snap_${CI_PIPELINE_ID}"
paths: [minizinc*.snap]
dependencies: []
only: [tags, develop]
tags: [linux, docker]
8 changes: 8 additions & 0 deletions MiniZincIDE.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
TEMPLATE = subdirs

SUBDIRS = MiniZincIDE

libminizinc {
SUBDIRS += libminizinc
MiniZincIDE.depends = libminizinc
}
14 changes: 14 additions & 0 deletions MiniZincIDE/CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
v2.3.0
- The IDE will now check MiniZinc code for syntax and type errors
- The editor performs simple code completion for MiniZinc keywords
- Ensure cursor is visible (editor scrolls to cursor position) when pressing
tab or enter. Fixes #71.
- Replace find dialog with inline widget and incremental search.
- Support dark mode on macOS.
- Add support for extra solver flags (parsed from solver configuration).
- IDE now only uses minizinc executable (not mzn2fzn and solns2out).
- Re-dock configuration editor when closing un-docked window.
- Handle quotes when parsing additional solver command line arguments.
Fixes #77.
- Add workaround for the missing libnss requirements
- Allow spaces in $DIR in MiniZincIDE.sh (Fixes #81)
v2.2.3
- Only run solution checker if it is enabled in the solver configuration dialog.
v2.2.2
Expand Down
Loading

0 comments on commit fee7337

Please sign in to comment.