Merge branch 'develop' into feature/netstandard-2.0

Project: http://git-wip-us.apache.org/repos/asf/logging-log4net/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4net/commit/8a43f89b
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4net/tree/8a43f89b
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4net/diff/8a43f89b

Branch: refs/heads/feature/netstandard-2.0
Commit: 8a43f89bb1867f3c68b618ab2b3f50126fa090d7
Parents: e666d9e 1db460b
Author: Dominik Psenner <dpsen...@apache.org>
Authored: Sat Aug 19 18:14:40 2017 +0200
Committer: Dominik Psenner <dpsen...@apache.org>
Committed: Sat Aug 19 18:14:40 2017 +0200

----------------------------------------------------------------------
 Jenkinsfile                                     | 16 ++++++--------
 .../docker/build-builder-netstandard-1.3.sh     | 23 ++++++++++++++++++++
 .../docker/build-builder-netstandard-2.0.sh     | 23 ++++++++++++++++++++
 buildtools/docker/build-builder-netstandard.sh  | 23 --------------------
 .../docker/builder-netstandard-1.3/Dockerfile   | 18 +++++++++++++++
 .../docker/builder-netstandard-2.0/Dockerfile   | 18 +++++++++++++++
 .../docker/builder-netstandard/Dockerfile       | 18 ---------------
 .../docker/run-builder-netstandard-1.3.sh       | 18 +++++++++++++++
 .../docker/run-builder-netstandard-2.0.sh       | 18 +++++++++++++++
 buildtools/docker/run-builder-netstandard.sh    | 18 ---------------
 log4net.build                                   | 20 ++++++++---------
 11 files changed, 135 insertions(+), 78 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4net/blob/8a43f89b/Jenkinsfile
----------------------------------------------------------------------
diff --cc Jenkinsfile
index 3f6f1b9,a13b52b..2604347
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@@ -65,40 -63,7 +63,40 @@@ pipeline 
                                                stash includes: 'bin/**/*.*', 
name: 'netstandard-1.3-assemblies'
  
                                                // test
-                                               sh "dotnet test 
tests/src/log4net.Tests.csproj"
 -                                              sh 'cd 
netstandard/log4net.tests && dotnet test --verbosity detailed'
++                                              sh "dotnet test 
tests/src/log4net.Tests.csproj --verbosity detailed"
 +                                      }
 +                              }
 +                      }
 +              }
 +              stage('build netstandard-2.0') {
 +                      steps {
 +                              script {
 +                                      checkout scm
-                                       def builder_dir = 
"buildtools/docker/builder-netstandard"
++                                      def builder_dir = 
"buildtools/docker/builder-netstandard-2.0"
 +
 +                                      // calculate args required to build the 
docker container
 +                                      def JENKINS_UID = sh (
 +                                              script: "stat -c \"%u\" 
$builder_dir",
 +                                              returnStdout: true
 +                                      ).trim()
 +                                      def JENKINS_GID = sh (
 +                                              script: "stat -c \"%g\" 
$builder_dir",
 +                                              returnStdout: true
 +                                      ).trim()
 +                                      echo "$JENKINS_UID"
 +                                      echo "$JENKINS_GID"
 +
 +                                      // build docker container
 +                                      def builder = docker.build 
'builder-netstandard:latest', "--file $builder_dir/Dockerfile --build-arg 
JENKINS_UID=$JENKINS_UID --build-arg JENKINS_GID=$JENKINS_GID $builder_dir"
 +
 +                                      // run docker container
 +                                      builder.inside {
 +                                              // compile
-                                               sh "dotnet build 
src/log4net.csproj -c Release -f netstandard2.0 -o ../bin/netstandard2.0"
++                                              sh "nant 
compile-netstandard-2.0"
 +                                              stash includes: 'bin/**/*.*', 
name: 'netstandard-2.0-assemblies'
 +
 +                                              // test
-                                               sh "dotnet test 
tests/src/log4net.Tests.csproj"
++                                              sh "dotnet test 
tests/src/log4net.Tests.csproj --verbosity detailed"
                                        }
                                }
                        }

http://git-wip-us.apache.org/repos/asf/logging-log4net/blob/8a43f89b/buildtools/docker/build-builder-netstandard-2.0.sh
----------------------------------------------------------------------
diff --cc buildtools/docker/build-builder-netstandard-2.0.sh
index 0000000,0000000..4839ae9
new file mode 100755
--- /dev/null
+++ b/buildtools/docker/build-builder-netstandard-2.0.sh
@@@ -1,0 -1,0 +1,23 @@@
++#!/bin/bash
++
++MY_PATH="`dirname \"$0\"`"              # relative
++MY_PATH="`( cd \"$MY_PATH\" && pwd )`"  # absolutized and normalized
++if [ -z "$MY_PATH" ] ; then
++  # error; for some reason, the path is not accessible
++  # to the script (e.g. permissions re-evaled after suid)
++  exit 1  # fail
++fi
++
++NAME="builder-netstandard-2.0"
++JENKINS_UID=$2
++if [ -z "$JENKINS_UID" ] ; then
++  JENKINS_UID="`stat -c \"%u\" $0`"
++fi
++
++JENKINS_GID=$3
++if [ -z "$JENKINS_GID" ] ; then
++  JENKINS_GID="`stat -c \"%g\" $0`"
++fi
++
++docker build --build-arg JENKINS_UID=$JENKINS_UID --build-arg 
JENKINS_GID=$JENKINS_GID --tag $NAME:latest $MY_PATH/$NAME
++

http://git-wip-us.apache.org/repos/asf/logging-log4net/blob/8a43f89b/buildtools/docker/builder-netstandard-1.3/Dockerfile
----------------------------------------------------------------------
diff --cc buildtools/docker/builder-netstandard-1.3/Dockerfile
index 0000000,6fd683a..9a6851a
mode 000000,100644..100644
--- a/buildtools/docker/builder-netstandard-1.3/Dockerfile
+++ b/buildtools/docker/builder-netstandard-1.3/Dockerfile
@@@ -1,0 -1,19 +1,18 @@@
+ FROM microsoft/dotnet:1.1.2-sdk-jessie
+ 
+ # define arguments passed in as environment variables
+ ARG JENKINS_UID
+ ARG JENKINS_GID
+ 
+ # set the maintainer of this docker image
+ MAINTAINER "d...@logging.apache.org"
+ 
+ # add custom workspace that can be written by anyone
+ RUN mkdir -p /var/workspaces && chmod 0777 /var/workspaces
+ 
+ # add jenkins user that maps to the custom workspace
+ RUN groupadd -r -g $JENKINS_GID jenkins-slave
+ RUN useradd --base-dir /var/workspaces --create-home --shell /bin/bash --uid 
$JENKINS_UID --gid $JENKINS_GID --groups $JENKINS_GID -p -M jenkins
+ 
+ # install dependencies
+ RUN apt-get update && apt-get install -y nant git
 -

http://git-wip-us.apache.org/repos/asf/logging-log4net/blob/8a43f89b/buildtools/docker/builder-netstandard-2.0/Dockerfile
----------------------------------------------------------------------
diff --cc buildtools/docker/builder-netstandard-2.0/Dockerfile
index 0000000,0000000..7351592
new file mode 100644
--- /dev/null
+++ b/buildtools/docker/builder-netstandard-2.0/Dockerfile
@@@ -1,0 -1,0 +1,18 @@@
++FROM microsoft/dotnet:2.0-sdk-jessie
++
++# define arguments passed in as environment variables
++ARG JENKINS_UID
++ARG JENKINS_GID
++
++# set the maintainer of this docker image
++MAINTAINER "d...@logging.apache.org"
++
++# add custom workspace that can be written by anyone
++RUN mkdir -p /var/workspaces && chmod 0777 /var/workspaces
++
++# add jenkins user that maps to the custom workspace
++RUN groupadd -r -g $JENKINS_GID jenkins-slave
++RUN useradd --base-dir /var/workspaces --create-home --shell /bin/bash --uid 
$JENKINS_UID --gid $JENKINS_GID --groups $JENKINS_GID -p -M jenkins
++
++# install dependencies
++RUN apt-get update && apt-get install -y nant git

http://git-wip-us.apache.org/repos/asf/logging-log4net/blob/8a43f89b/buildtools/docker/run-builder-netstandard-2.0.sh
----------------------------------------------------------------------
diff --cc buildtools/docker/run-builder-netstandard-2.0.sh
index 0000000,0000000..25f8086
new file mode 100755
--- /dev/null
+++ b/buildtools/docker/run-builder-netstandard-2.0.sh
@@@ -1,0 -1,0 +1,18 @@@
++#!/bin/bash
++
++MY_PATH="`dirname \"$0\"`"              # relative
++MY_PATH="`( cd \"$MY_PATH\" && pwd )`"  # absolutized and normalized
++if [ -z "$MY_PATH" ] ; then
++  # error; for some reason, the path is not accessible
++  # to the script (e.g. permissions re-evaled after suid)
++  echo "Path is not accessible to the script"
++  exit 1  # fail
++fi
++
++WORKING_DIR="$1"
++if [ -z "$WORKING_DIR" ]; then
++      WORKING_DIR=$(pwd)
++fi
++
++$MY_PATH/run.sh "builder-netstandard-2.0" $WORKING_DIR
++

http://git-wip-us.apache.org/repos/asf/logging-log4net/blob/8a43f89b/log4net.build
----------------------------------------------------------------------
diff --cc log4net.build
index d491706,f08133f..08997d1
--- a/log4net.build
+++ b/log4net.build
@@@ -1748,16 -1748,16 +1748,16 @@@ limitations under the License
        </csc>
      </if>
    </target>
-   <!-- these targets build lognet assemblies against .NET Standard 1.3 and 
2.0 -->
-   <target name="compile-netstandard-1.3" description="Builds .NET Standard 
1.3">
 -  <!-- these targets build lognet assemblies against .NET Core (.net standard 
1.3)-->
++  <!-- these targets build lognet assemblies against .NET Standard 1.3 -->
+   <target name="compile-netstandard-1.3" description="Builds .NET Core">
      <call target="set-debug-build-configuration"/>
-     <call target="compile-netstandard1.3-current-configuration"/>
+     <call target="compile-netstandard-1.3-current-configuration"/>
      <call target="set-release-build-configuration"/>
-     <call target="compile-netstandard1.3-current-configuration"/>
+     <call target="compile-netstandard-1.3-current-configuration"/>
    </target>
-   <target name="compile-netstandard1.3-current-configuration">
+   <target name="compile-netstandard-1.3-current-configuration">
      <echo message="dotnet --version"/>
 -    <exec program="dotnet" workingdir="netstandard" failonerror="false" 
resultproperty="dotnet.available">
 +    <exec program="dotnet" workingdir="${log4net.basedir}" 
failonerror="false" resultproperty="dotnet.available">
        <arg value="--version"/>
      </exec>
      <if test="${dotnet.available != '0'}">
@@@ -1786,49 -1789,7 +1786,49 @@@
        </if>
        <ifnot test="${current.build.config.release}">
          <move todir="${log4net.basedir}/bin/netstandard/1.3/debug">
 -          <fileset basedir="netstandard/log4net/bin/Debug/netstandard1.3"/>
 +          <fileset basedir="${log4net.basedir}/src/bin/Debug/netstandard1.3"/>
 +        </move>
 +      </ifnot>
 +    </if>
 +  </target>
 +  <target name="compile-netstandard-2.0" description="Builds .NET Standard 
2.0">
 +    <call target="set-debug-build-configuration"/>
-     <call target="compile-netstandard2.0-current-configuration"/>
++    <call target="compile-netstandard-2.0-current-configuration"/>
 +    <call target="set-release-build-configuration"/>
-     <call target="compile-netstandard2.0-current-configuration"/>
++    <call target="compile-netstandard-2.0-current-configuration"/>
 +  </target>
-   <target name="compile-netstandard2.0-current-configuration">
++  <target name="compile-netstandard-2.0-current-configuration">
 +    <echo message="dotnet --version"/>
 +    <exec program="dotnet" workingdir="${log4net.basedir}" 
failonerror="false" resultproperty="dotnet.available">
 +      <arg value="--version"/>
 +    </exec>
 +    <if test="${dotnet.available != '0'}">
 +      <echo message="Skipping build; required framework is not available: 
netstandard"/>
 +    </if>
 +    <if test="${dotnet.available == '0'}">
 +      <if test="${current.build.config.release != '-c'}">
 +        <echo message="dotnet build log4net.csproj"/>
 +      </if>
 +      <if test="${current.build.config.release == '-c'}">
 +        <echo message="dotnet build log4net.csproj -c Release"/>
 +      </if>
 +      <exec program="dotnet" workingdir="${log4net.basedir}/src">
 +        <arg value="build"/>
 +        <arg value="log4net.csproj"/>
 +        <arg value="-f"/>
 +        <arg value="netstandard2.0"/>
 +        <arg if="${current.build.config.release}" value="-c"/>
 +        <arg if="${current.build.config.release}" value="Release"/>
 +      </exec>
 +      <mkdir dir="${log4net.basedir}/bin/netstandard/2.0"/>
 +      <if test="${current.build.config.release}">
 +        <move todir="${log4net.basedir}/bin/netstandard/2.0/release">
 +          <fileset 
basedir="${log4net.basedir}/src/bin/Release/netstandard2.0"/>
 +        </move>
 +      </if>
 +      <ifnot test="${current.build.config.release}">
 +        <move todir="${log4net.basedir}/bin/netstandard/2.0/debug">
 +          <fileset basedir="${log4net.basedir}/src/bin/Debug/netstandard2.0"/>
          </move>
        </ifnot>
      </if>

Reply via email to