Skip to content

Commit

Permalink
Add Imageflow.NativeTool nuget packages
Browse files Browse the repository at this point in the history
  • Loading branch information
lilith committed Oct 19, 2017
1 parent 8d701f6 commit 960578b
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 26 deletions.
1 change: 1 addition & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ test_script:
- cd %APPVEYOR_BUILD_FOLDER%
- appveyor PushArtifact "%ARTIFACT_NAME%.zip"
- sh ./ci/pack_nuget/pack.sh
- sh ./ci/pack_nuget/pack.sh tool
- echo. && echo. && echo Cleaning up
- rmdir /q /s .\%TARGET_DIR%doc || exit 0
- rmdir /q /s .\%TARGET_DIR%debug || exit 0
Expand Down
3 changes: 2 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -690,8 +690,9 @@ if [[ "$BUILD_RELEASE" == 'True' ]]; then
cp -a ${TARGET_DIR}doc/* "./artifacts/upload/${DOCS_UPLOAD_DIR_2}/"
fi

# Create the nuget artifact
# Create the nuget artifacts
./ci/pack_nuget/pack.sh
./ci/pack_nuget/pack.sh tool

fi
echo_maybe
Expand Down
4 changes: 2 additions & 2 deletions ci/pack_nuget/native.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
<authors>Imazen, nathanaeljones</authors>
<owners>Imazen, nathanaeljones</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Imageflow is a fast, correct image processing library for web servers</description>
<description>Imageflow is a fast, correct image processing library for web servers. This package contains only the native library; see Imageflow.Net for the managed wrapper. </description>
<copyright>AGPLv3 or commercial</copyright>
<tags>imageflow imazen</tags>
<dependencies>
<group targetFramework=".NETStandard1.0" />
</dependencies>
</metadata>
</package>
</package>
16 changes: 16 additions & 0 deletions ci/pack_nuget/native_tool.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>:id:</id>
<version>:version:</version>
<authors>Imazen, nathanaeljones</authors>
<owners>Imazen, nathanaeljones</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>imageflow_tool is a fast, correct image processing tool suitable for web servers. This package contains only the native executable; see Imageflow.Net for a managed wrapper.</description>
<copyright>AGPLv3 or commercial</copyright>
<tags>imageflow imazen imageflow_tool</tags>
<dependencies>
<group targetFramework=".NETStandard1.0" />
</dependencies>
</metadata>
</package>
48 changes: 26 additions & 22 deletions ci/pack_nuget/pack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ set -e #Exit on failure.
# REQUIRES PACKAGE_SUFFIX
# REQUIRES NUGET_RUNTIME
# REQUIRES CI_TAG
export NUGET_PACKAGE_NAME=Imageflow.NativeRuntime.${PACKAGE_SUFFIX}

if [[ "$1" == "tool" ]]; then
export NUGET_PACKAGE_NAME=Imageflow.NativeTool.${PACKAGE_SUFFIX}
else
export NUGET_PACKAGE_NAME=Imageflow.NativeRuntime.${PACKAGE_SUFFIX}
fi


if [[ "$CI_TAG" == 'v'* ]]; then
Expand Down Expand Up @@ -36,40 +41,38 @@ mkdir -p "$STAGING_DIR" || true
PROPS_PATH="build/net45/${NUGET_PACKAGE_NAME}.props"
NUGET_OUTPUT_DIR="${SCRIPT_DIR}/../../artifacts/nuget"
NUGET_OUTPUT_FILE="${NUGET_OUTPUT_DIR}/${NUGET_COMBINED_NAME}.nupkg"
echo RELEASE_DIR=$RELEASE_DIR
echo RELEASE_DIR=${RELEASE_DIR}

mkdir -p "${NUGET_OUTPUT_DIR}" || true


if [[ "${NUGET_RUNTIME}" == *'win'* ]]; then
LIB_NAME=imageflow.dll
TOOL_NAME=imageflow_tool.exe
elif [[ "${NUGET_RUNTIME}" == *'osx'* ]]; then
LIB_NAME=libimageflow.dylib
TOOL_NAME=imageflow_tool
else
LIB_NAME=libimageflow.so
TOOL_NAME=imageflow_tool
fi

#mkdir -p _rels
#cat ../../.rels | sed -e "s/:nuspec_name:/${NUGET_PACKAGE_NAME}.nuspec/g" > "_rels/.rels"
#cp "../../[Content_Types].xml" "[Content_Types].xml"


mkdir -p lib/netstandard1.0
echo "" > lib/netstandard1.0/_._

mkdir -p "$RUNTIME_DIR"
cp "${RELEASE_DIR}${LIB_NAME}" "${RUNTIME_DIR}${LIB_NAME}"
if [[ "$1" == "tool" ]]; then
cp "${RELEASE_DIR}${TOOL_NAME}" "${RUNTIME_DIR}${TOOL_NAME}"
else
cp "${RELEASE_DIR}${LIB_NAME}" "${RUNTIME_DIR}${LIB_NAME}"
fi


SED_NUGET_PACKAGE_NAME="$(echo $NUGET_PACKAGE_NAME | sed -e 's/[\/&]/\\&/g')"
SED_NUGET_PACKAGE_VERSION="$(echo $NUGET_PACKAGE_VERSION | sed -e 's/[\/&]/\\&/g')"
SED_NUGET_PACKAGE_NAME="$(echo $NUGET_PACKAGE_NAME | sed -e 's/[\/&]/\\&/g')"
SED_NUGET_LIBFILE="$(echo $RUNTIME_DIR$LIB_NAME | sed -e 's/[\/&]/\\&/g' | sed -e 's/\//\\/g')" # fix slashes too
PROPS_PATH="$(echo $PROPS_PATH | sed -e 's/\//\\/g')" #fix slashes
PROPS="<file src=\"$PROPS_PATH\" target=\"$PROPS_PATH\" />"
SED_NUGET_PROPS="$(echo $PROPS | sed -e 's/[\/&]/\\&/g')"




if [[ "${NUGET_RUNTIME}" == *'win'* ]]; then

if [[ "${NUGET_RUNTIME}" == *'x64'* ]]; then
Expand All @@ -82,15 +85,16 @@ mkdir -p "$STAGING_DIR" || true
cat ../../imageflow_x86.props | sed -e "s/:rid:/$NUGET_RUNTIME/g" > "$PROPS_PATH"
fi
fi

# If these elements turn out to be needed, re-add them to native.nuspec
#<file src="lib\netstandard1.0\_._" target="lib\netstandard1.0\_._" />
#<file src=":libfile:" target=":libfile:" />
cat ../../native.nuspec \

if [[ "$1" == "tool" ]]; then
NUSPEC_NAME="native_tool.nuspec"
else
NUSPEC_NAME="native.nuspec"
fi

cat ../../${NUSPEC_NAME} \
| sed -e "s/:id:/${SED_NUGET_PACKAGE_NAME}/g" \
| sed -e "s/:version:/${SED_NUGET_PACKAGE_VERSION}/g" \
| sed -e "s/:libfile:/${SED_NUGET_LIBFILE}/" \
| sed -e "s/:props:/${SED_NUGET_PROPS}/" > "${NUGET_PACKAGE_NAME}.nuspec"
| sed -e "s/:version:/${SED_NUGET_PACKAGE_VERSION}/g" > "${NUGET_PACKAGE_NAME}.nuspec"


echo "${NUGET_PACKAGE_NAME}.nuspec:"
Expand Down
2 changes: 1 addition & 1 deletion ci/pack_nuget/test_pack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ export CI_TAG="v0.9-rc1-1"
export PACKAGE_SUFFIX="ubuntu_14_04-x86_64"
export NUGET_RUNTIME="ubuntu.14.04-x64"

./pack.sh
./pack.sh tool

0 comments on commit 960578b

Please sign in to comment.