Skip to content

Commit

Permalink
Merge branch 'pr1827' into stable
Browse files Browse the repository at this point in the history
* pr1827:
  (GH-1020) Direct platform only for windows tests
  (GH-1020) WindowsOnly tests by platform, not ignore
  (GH-1020) Docker add ChocolateyInstall Env Var
  (GH-1020) Docker use code_drop instead of build_output
  (doc) Update mono installation instructions in README
  (GH-1020) Dockerfile and Travis to Mono 5.20.1
  (GH-1020) Add mono-4.5 configuration
  • Loading branch information
ferventcoder committed Mar 25, 2020
2 parents 385076d + 22fe302 commit c28a3e3
Show file tree
Hide file tree
Showing 12 changed files with 355 additions and 43 deletions.
24 changes: 12 additions & 12 deletions .build/compile.step
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<property name="solution.path" value="${path::get-full-path(solution.path)}" />
<property name="solution.path.windows.mono" value="${string::replace(dirs.current,'\','/')}/${string::replace(path_to_solution,'\','/')}/${project.name}.sln" />
<property name="solution.path" value="${dirs.current}${path.separator}${path_to_solution}${path.separator}${project.name}.vbp" if="${microsoft.framework =='vb6'}" />
<property name="nant.settings.currentframework" value="mono-4.0" if="${platform::is-unix()}" overwrite="true" />
<property name="nant.settings.currentframework" value="mono-4.5" if="${platform::is-unix()}" overwrite="true" />
<property name="nant.settings.currentframework" value="net-3.5" if="${microsoft.framework !='vb6' and platform::is-windows()}" overwrite="false" />
<property name="framework.multitargeting" value="false" />
<property name="framework.multitargeting.delimiter" value="," />
Expand Down Expand Up @@ -106,30 +106,30 @@
<mkdir dir="${msbuild.outputpath}" />
<if test="${platform::is-unix()}">
<!-- Do clean and build in two steps since xbuild has a bug with using OutputPath and Rebuild together Bug #628525 at Novell -->
<echo level="Warning" message="Cleaning build..." if="${microsoft.framework.specific != 'mono-4.0'}" />
<echo level="Warning" message="Cleaning build..." if="${microsoft.framework.specific != 'mono-4.5'}" />
<exec program="${app.xbuild}"
basedir="/usr/bin"
workingdir="${dirs.build}"
commandline="${solution.path} /nologo /property:OutputPath='${msbuild.outputpath}' /property:Configuration=${msbuild.configuration} /verbosity:minimal /noconsolelogger /target:Clean" if="${microsoft.framework.specific != 'mono-4.0'}" />
commandline="${solution.path} /nologo /property:OutputPath='${msbuild.outputpath}' /property:Configuration=${msbuild.configuration} /verbosity:minimal /noconsolelogger /target:Clean" if="${microsoft.framework.specific != 'mono-4.5'}" />
<echo level="Warning" message="Building..." />
<echo level="Warning" message="Working directory ${dirs.build}" />
<echo level="Warning" message="Running ${app.xbuild} ${solution.path} /nologo /property:OutputPath='${msbuild.outputpath}' /property:Configuration=${msbuild.configuration} /verbosity:detailed /toolsversion:${framework::get-version(microsoft.framework.specific)} /property:Platform='${msbuild.platform}' /property:TargetFrameworkVersion=v${framework::get-version(microsoft.framework.specific)} /l:${msbuild.logger};'${dirs.build_results}${path.separator}msbuild-${microsoft.framework.specific}-results.xml'" />
<exec program="${app.xbuild}"
basedir="/usr/bin"
workingdir="${dirs.build}"
commandline="${solution.path} /nologo /property:OutputPath='${msbuild.outputpath}' /property:Configuration=${msbuild.configuration} /verbosity:detailed /toolsversion:${framework::get-version(microsoft.framework.specific)} /property:Platform='${msbuild.platform}' /property:TargetFrameworkProfile='' /property:TargetFrameworkVersion=v${framework::get-version(microsoft.framework.specific)} /l:${msbuild.logger};'${dirs.build_results}${path.separator}msbuild-${microsoft.framework.specific}-results.xml'" />
commandline="${solution.path} /nologo /property:OutputPath='${msbuild.outputpath}' /property:Configuration=${msbuild.configuration} /verbosity:detailed /toolsversion:4.0 /property:Platform='${msbuild.platform}' /property:TargetFrameworkProfile='' /property:TargetFrameworkVersion=v${framework::get-version(microsoft.framework.specific)} /l:${msbuild.logger};'${dirs.build_results}${path.separator}msbuild-${microsoft.framework.specific}-results.xml'" />
</if>
<if test="${platform::is-windows()}">
<!-- nant is retarded - I had to have four of these instead of throwing an if on the outputpath and targets -->
<if test="${msbuild.override_output_path}">
<if test="${framework.multitargeting}">
<if test="${framework::get-family(microsoft.framework.specific) == 'mono'}" >
<!-- Do clean and build in two steps since xbuild has a bug with using OutputPath and Rebuild together Bug #628525 at Novell -->
<echo level="Warning" message="Cleaning build..." if="${microsoft.framework.specific != 'mono-4.0'}" />
<echo level="Warning" message="Cleaning build..." if="${microsoft.framework.specific != 'mono-4.5'}" />
<exec program="${app.xbuild}"
basedir="${dirs.build.windows.mono}"
workingdir="${dirs.build.windows.mono}"
commandline="${solution.path.windows.mono} /nologo /property:OutputPath='${msbuild.outputpath}' /property:Configuration=${msbuild.configuration} /verbosity:minimal /noconsolelogger /target:Clean" if="${microsoft.framework.specific != 'mono-4.0'}" />
commandline="${solution.path.windows.mono} /nologo /property:OutputPath='${msbuild.outputpath}' /property:Configuration=${msbuild.configuration} /verbosity:minimal /noconsolelogger /target:Clean" if="${microsoft.framework.specific != 'mono-4.5'}" />
<echo level="Warning" message='Building...by running this command ${app.xbuild} ${solution.path.windows.mono} /nologo /property:OutputPath="${msbuild.outputpath.windows.mono}" /property:Configuration=${msbuild.configuration} /verbosity:minimal' />
<exec program="${app.xbuild}"
basedir="${dirs.build.windows.mono}"
Expand Down Expand Up @@ -158,11 +158,11 @@
<if test="${not framework.multitargeting}">
<if test="${framework::get-family(microsoft.framework.specific) == 'mono'}" >
<!-- Do clean and build in two steps since xbuild has a bug with using OutputPath and Rebuild together Bug #628525 at Novell -->
<echo level="Warning" message="Cleaning build..." if="${microsoft.framework.specific != 'mono-4.0'}" />
<echo level="Warning" message="Cleaning build..." if="${microsoft.framework.specific != 'mono-4.5'}" />
<exec program="${app.xbuild}"
basedir="${dirs.build.windows.mono}"
workingdir="${dirs.build.windows.mono}"
commandline="${solution.path.windows.mono} /nologo /property:OutputPath='${msbuild.outputpath}' /property:Configuration=${msbuild.configuration} /verbosity:minimal /noconsolelogger /target:Clean" if="${microsoft.framework.specific != 'mono-4.0'}" />
commandline="${solution.path.windows.mono} /nologo /property:OutputPath='${msbuild.outputpath}' /property:Configuration=${msbuild.configuration} /verbosity:minimal /noconsolelogger /target:Clean" if="${microsoft.framework.specific != 'mono-4.5'}" />
<echo level="Warning" message='Building without multitargeting by running this command ${app.xbuild} ${solution.path.windows.mono} /nologo /property:OutputPath="${msbuild.outputpath.windows.mono}" /property:Configuration=${msbuild.configuration} /verbosity:minimal' />
<exec program="${app.xbuild}"
basedir="${dirs.build.windows.mono}"
Expand Down Expand Up @@ -191,11 +191,11 @@
<if test="${framework.multitargeting}">
<if test="${framework::get-family(microsoft.framework.specific) == 'mono'}" >
<!-- Do clean and build in two steps since xbuild has a bug with using OutputPath and Rebuild together Bug #628525 at Novell -->
<echo level="Warning" message="Cleaning build..." if="${microsoft.framework.specific != 'mono-4.0'}" />
<echo level="Warning" message="Cleaning build..." if="${microsoft.framework.specific != 'mono-4.5'}" />
<exec program="${app.xbuild}"
basedir="${dirs.build}"
workingdir="${dirs.build}"
commandline="${solution.path} /nologo /property:Configuration=${msbuild.configuration} /verbosity:minimal /noconsolelogger /target:Clean" if="${microsoft.framework.specific != 'mono-4.0'}" />
commandline="${solution.path} /nologo /property:Configuration=${msbuild.configuration} /verbosity:minimal /noconsolelogger /target:Clean" if="${microsoft.framework.specific != 'mono-4.5'}" />
<echo level="Warning" message="Building..." />
<exec program="${app.xbuild}"
basedir="${dirs.build}"
Expand All @@ -222,11 +222,11 @@
<if test="${not framework.multitargeting}">
<if test="${framework::get-family(microsoft.framework.specific) == 'mono'}" >
<!-- Do clean and build in two steps since xbuild has a bug with using OutputPath and Rebuild together Bug #628525 at Novell -->
<echo level="Warning" message="Cleaning build..." if="${microsoft.framework.specific != 'mono-4.0'}" />
<echo level="Warning" message="Cleaning build..." if="${microsoft.framework.specific != 'mono-4.5'}" />
<exec program="${app.xbuild}"
basedir="${dirs.build.windows.mono}"
workingdir="${dirs.build.windows.mono}"
commandline="${solution.path.windows.mono} /nologo /property:Configuration=${msbuild.configuration} /verbosity:minimal /noconsolelogger /target:Clean" if="${microsoft.framework.specific != 'mono-4.0'}" />
commandline="${solution.path.windows.mono} /nologo /property:Configuration=${msbuild.configuration} /verbosity:minimal /noconsolelogger /target:Clean" if="${microsoft.framework.specific != 'mono-4.5'}" />
<echo level="Warning" message="Building...by running this command ${app.xbuild} ${solution.path.windows.mono} /nologo /property:Configuration=${msbuild.configuration} /verbosity:minimal" />
<exec program="${app.xbuild}"
basedir="${dirs.build.windows.mono}"
Expand Down
2 changes: 1 addition & 1 deletion .build/default.build.settings
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
<property name="fail.build.on.error" value="true" />

<!-- FRAMEWORKS -->
<!-- microsoft.framework: vb6, net-1.0, net-1.1, net-2.0, net-3.5, net-4.0, net-4.5, netcf-1.0, netcf-2.0, silverlight-2.0, mono-1.0, mono-2.0, mono-3.5, mono-4.0, moonlight-2.0 (Enter multiple ones with a "," to take advantage of multitargeting) -->
<!-- microsoft.framework: vb6, net-1.0, net-1.1, net-2.0, net-3.5, net-4.0, net-4.5, netcf-1.0, netcf-2.0, silverlight-2.0, mono-1.0, mono-2.0, mono-3.5, mono-4.0, mono-4.5, moonlight-2.0 (Enter multiple ones with a "," to take advantage of multitargeting) -->
<property name="microsoft.framework" value="net-4.0" overwrite="false" />
<!-- language.short: vb,cs -->
<property name="language.short" value="cs" overwrite="false" />
Expand Down
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
language: csharp
mono:
- 3.12.0
- 5.20.1
install:
- sudo apt-get install mono-devel mono-gmcs
- sudo apt-get install mono-devel
- nuget restore src/chocolatey.sln
before_script:
- chmod +x build.sh
Expand Down
63 changes: 50 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,42 +137,79 @@ Running the build on Windows should produce an artifact that is tested and ready
#### Other Platforms
##### Prerequisites:

* Install and configure Mono 3.12.0 (3.8.0 should also work).
* Install and configure Mono 5.20.x (Other versions may work but have not been tested).
* [Debian based](http://www.mono-project.com/docs/getting-started/install/linux/#debian-ubuntu-and-derivatives)

```sh
# install prerequisites
sudo apt install apt-transport-https dirmngr gnupg ca-certificates
# add the key
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
# add the package repository
echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list
# Ubuntu 12.10/12.04 - add this deb as well
echo "deb http://download.mono-project.com/repo/debian wheezy-libtiff-compat main" | sudo tee -a /etc/apt/sources.list.d/mono-xamarin.list
# Debian 10
echo "deb https://download.mono-project.com/repo/debian stable-buster main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list
# Debian 9
echo "deb https://download.mono-project.com/repo/debian stable-stretch main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list
# Ubuntu 18.04
echo "deb https://download.mono-project.com/repo/ubuntu stable-bionic main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list
# Ubuntu 16.04
echo "deb https://download.mono-project.com/repo/ubuntu stable-xenial main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list

# update package indexes
sudo apt-get update
# install
sudo apt-get install mono-devel -y
```

* [RPM Based](http://www.mono-project.com/docs/getting-started/install/linux/#centos-fedora-and-derivatives)
* [CentOS/RHEL](https://www.mono-project.com/download/stable/#download-lin-centos)

```sh
### NOT FULLY TESTED AND WORKING ###
# add the EPEL
sudo yum install epel-release -y
# Switch to root shell
su
# Add the EPEL
yum install epel-release -y
# Add the key
sudo rpm --import "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"
pmkeys --import "http://pool.sks-keyservers.net/pks/lookup?op=get&search=0x3fa7e0328081bff6a14da29aa6a19b38d3d831ef"

# Add the package repository
sudo yum-config-manager --add-repo http://download.mono-project.com/repo/centos/
# CentOS/RHEL 8
su -c 'curl https://download.mono-project.com/repo/centos8-stable.repo | tee /etc/yum.repos.d/mono-centos8-stable.repo'
# CentOS/RHEL 7
su -c 'curl https://download.mono-project.com/repo/centos7-stable.repo | tee /etc/yum.repos.d/mono-centos7-stable.repo'
# CentOS/RHEL 6
rpm --import "http://pool.sks-keyservers.net/pks/lookup?op=get&search=0x3fa7e0328081bff6a14da29aa6a19b38d3d831ef"

# update your system
sudo yum update -y
# Update your system
yum update -y

# Install mono-devel
sudo yum install mono-devel -y
yum install mono-devel -y

```

* [Fedora](https://www.mono-project.com/download/stable/#download-lin-fedora)

```sh
### NOT FULLY TESTED AND WORKING ###

# Switch to root shell
su
# Add the key
rpm --import "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"

# Add the package repository
# Fedora 29
su -c 'curl https://download.mono-project.com/repo/centos8-stable.repo | tee /etc/yum.repos.d/mono-centos8-stable.repo'
# Fedora 28
su -c 'curl https://download.mono-project.com/repo/centos7-stable.repo | tee /etc/yum.repos.d/mono-centos7-stable.repo'

# Update
dnf update

# Install mono-devel
dnf install mono-devel -y

```

Expand Down
5 changes: 2 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ displayUsage $1
export PKG_CONFIG_PATH=/opt/local/lib/pkgconfig:/Library/Frameworks/Mono.framework/Versions/Current/lib/pkgconfig:$PKG_CONFIG_PATH

#mono ./lib/NAnt/NAnt.exe /logger:"NAnt.Core.DefaultLogger" /nologo /quiet /f:"$(cd $(dirname "$0"); pwd)/.build/default.build" /D:build.config.settings="$(cd $(dirname "$0"); pwd)/.uppercut" /D:microsoft.framework="mono-3.5" $*
mono --runtime=v4.0.30319 ./lib/NAnt/NAnt.exe /logger:"NAnt.Core.DefaultLogger" /nologo /quiet /f:"$(cd $(dirname "$0"); pwd)/.build/default.build" /D:build.config.settings="$(cd $(dirname "$0"); pwd)/.uppercut" /D:microsoft.framework="mono-4.0" /D:run.ilmerge="false" /D:run.nuget="false" $*

#/quiet /nologo /debug /verbose /t:"mono-4.0"
mono --runtime=v4.0.30319 ./lib/NAnt/NAnt.exe /logger:"NAnt.Core.DefaultLogger" /nologo /quiet /f:"$(cd $(dirname "$0"); pwd)/.build/default.build" /D:build.config.settings="$(cd $(dirname "$0"); pwd)/.uppercut" /D:microsoft.framework="mono-4.5" /D:run.ilmerge="false" /D:run.nuget="false" $*

#/quiet /nologo /debug /verbose /t:"mono-4.5"
6 changes: 4 additions & 2 deletions docker/Dockerfile.linux
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mono:3.12.1
FROM mono:5.20.1.19

MAINTAINER Justin Phelps <[email protected]>

Expand All @@ -10,8 +10,10 @@ RUN chmod +x zip.sh
RUN ./build.sh

WORKDIR /usr/local/bin
RUN ln -s /usr/local/src/choco/build_output/chocolatey
RUN ln -s /usr/local/src/choco/code_drop/chocolatey

COPY docker/choco_wrapper /usr/local/bin/choco

ENV ChocolateyInstall /usr/local/bin/chocolatey

WORKDIR /root
2 changes: 1 addition & 1 deletion docker/choco_wrapper
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

mono /usr/local/bin/chocolatey/choco.exe "$@" --allow-unofficial
mono /usr/local/bin/chocolatey/console/choco.exe "$@" --allow-unofficial
Loading

0 comments on commit c28a3e3

Please sign in to comment.