OUTDIR=$SCRIPT_DIR/Artifacts
-NUGET_CMD="mono $SCRIPT_DIR/tools/NuGet.exe"
-RETRY_CMD="$SCRIPT_DIR/tools/retry.sh"
-TIMEOUT_CMD="$SCRIPT_DIR/tools/timeout.sh"
+RETRY_CMD="$SCRIPT_DIR/tools/scripts/retry.sh"
+TIMEOUT_CMD="$SCRIPT_DIR/tools/scripts/timeout.sh"
DOTNET_CMD="$RETRY_CMD $TIMEOUT_CMD 600 dotnet"
RUN_BUILD="$DOTNET_CMD msbuild $SCRIPT_DIR/build/build.proj /nologo"
-RUN_BUILD_DUMMY="$DOTNET_CMD build $SCRIPT_DIR/build/build.dummy.csproj"
+
+VERSION_PREFIX=5.0.0
usage() {
- echo "Usage: %0 [command] [args]"
+ echo "Usage: $0 [command] [args]"
echo "Commands:"
echo " build [module] Build a specific module"
echo " full Build all modules in src/ directory"
+ echo " ext Build external modules in externals/ directory"
echo " dummy Generate dummy assemblies of all modules"
echo " pack [version] Make a NuGet package with build artifacts"
echo " clean Clean all artifacts"
if [ -d /nuget ]; then
NUGET_SOURCE_OPT="/p:RestoreSources=/nuget"
fi
- $RUN_BUILD_DUMMY $NUGET_SOURCE_OPT
+ $RUN_BUILD /t:restore $NUGET_SOURCE_OPT
+ $RUN_BUILD /t:dummy $NUGET_SOURCE_OPT
+}
+
+cmd_ext_build() {
+ if [ -d /nuget ]; then
+ NUGET_SOURCE_OPT="/p:RestoreSources=/nuget;$SCRIPT_DIR/packages;$SCRIPT_DIR/Artifacts"
+ fi
+ PROJECTS=$(ls -1 $SCRIPT_DIR/externals/*.proj)
+ for p in $PROJECTS; do
+ $DOTNET_CMD msbuild $p /t:Build $NUGET_SOURCE_OPT /nologo
+ done
}
cmd_pack() {
VERSION=$1
- VERSION_INTERNAL=$2
if [ -z "$VERSION" ]; then
- TIMESTAMP=$(date +"%s")
- VERSION="4.0.1-local-$TIMESTAMP"
- fi
- if [ -z "$VERSION_INTERNAL" ]; then
- VERSION_INTERNAL=$VERSION
+ VERSION=$VERSION_PREFIX.$((10000+$(git rev-list --count HEAD)))
fi
- $NUGET_CMD pack $SCRIPT_DIR/pkg/Tizen.NET.nuspec -NoPackageAnalysis -Version $VERSION -BasePath $SCRIPT_DIR -OutputDirectory $OUTDIR
- $NUGET_CMD pack $SCRIPT_DIR/pkg/Tizen.NET.API4.nuspec -NoPackageAnalysis -Version $VERSION -BasePath $SCRIPT_DIR -OutputDirectory $OUTDIR
- $NUGET_CMD pack $SCRIPT_DIR/pkg/Tizen.NET.Internals.nuspec -NoPackageAnalysis -Version $VERSION_INTERNAL -BasePath $SCRIPT_DIR -OutputDirectory $OUTDIR
+ $RUN_BUILD /t:pack /p:Version=$VERSION
}
cmd_clean() {
cmd=$1; shift;
case "$cmd" in
build|--build|-b) cmd_build $@ ;;
- full |--full |-f) cmd_full_build $@ ;;
+ full |--full |-f) cmd_full_build $@ ;;
dummy|--dummy|-d) cmd_dummy_build $@ ;;
- pack |--pack |-p) cmd_pack $@ ;;
+ ext |--ext |-e) cmd_ext_build $@ ;;
+ pack |--pack |-p) cmd_pack $@ ;;
clean|--clean|-c) cmd_clean $@ ;;
- *) usage ;;
+ *) usage ;;
esac