Skip to content

Commit

Permalink
Merge branch 'release-0.15.0' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
belkiss committed Feb 15, 2021
2 parents 9cf3f65 + 9da3857 commit 1775159
Show file tree
Hide file tree
Showing 279 changed files with 3,041 additions and 1,922 deletions.
32 changes: 0 additions & 32 deletions .appveyor.yml

This file was deleted.

54 changes: 54 additions & 0 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Sharpmake GitHub Actions CI configuration

name: build
on: [push, pull_request]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
configuration: [debug, release]

env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true

steps:
- name: Checkout the repo
uses: actions/checkout@v2

- name: Bootstrap.bat ${{ matrix.configuration }}
if: runner.os == 'Windows'
shell: cmd
run: bootstrap.bat Sharpmake.Main.sharpmake.cs ${{ matrix.configuration }}

- name: Bootstrap.sh ${{ matrix.configuration }}
if: runner.os != 'Windows'
shell: bash
run: ./bootstrap.sh Sharpmake.Main.sharpmake.cs ${{ matrix.configuration }}

- name: CompileSharpmake.bat ${{ matrix.configuration }}
if: runner.os == 'Windows'
shell: cmd
run: CompileSharpmake.bat Sharpmake.sln "${{ matrix.configuration }}" "Any CPU"

- name: CompileSharpmake.sh ${{ matrix.configuration }}
if: runner.os != 'Windows'
shell: bash
run: ./CompileSharpmake.sh Sharpmake.sln "${{ matrix.configuration }}"

- name: UnitTest
if: runner.os == 'Windows'
run: |
nuget install NUnit.ConsoleRunner -Version 3.12.0 -OutputDirectory tmp/pkg
tmp/pkg/NUnit.ConsoleRunner.3.12.0/tools/nunit3-console.exe tmp/unittests/${{ matrix.configuration }}/Sharpmake.UnitTests.dll
- name: RegressionTest
if: runner.os == 'Windows'
run: python regression_test.py

- name: FunctionalTest
if: runner.os == 'Windows'
run: python functional_test.py
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ _ReSharper*/
project.json
project.lock.json
Sharpmake.VC.db

.vscode
.idea

# Desktop Services Store on MacOS
Expand Down
41 changes: 32 additions & 9 deletions CompileSharpmake.bat
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
:: if none are passed, defaults to building Sharpmake.sln in Debug|AnyCPU

setlocal enabledelayedexpansion

:: Clear previous run status
COLOR

: set batch file directory as current
pushd "%~dp0"

Expand All @@ -16,7 +20,7 @@ if not exist %VSWHERE% (
)

set VSMSBUILDCMD=
for /f "usebackq delims=" %%i in (`%VSWHERE% -latest -property installationPath`) do (
for /f "usebackq delims=" %%i in (`%VSWHERE% -latest -products * -property installationPath`) do (
if exist "%%i\Common7\Tools\VsMSBuildCmd.bat" (
set VSMSBUILDCMD="%%i\Common7\Tools\VsMSBuildCmd.bat"
)
Expand All @@ -26,31 +30,50 @@ if not defined VSMSBUILDCMD (
echo ERROR: Cannot determine the location of Common Tools folder.
goto error
)

echo MSBuild batch path: !VSMSBUILDCMD!
call !VSMSBUILDCMD!
if %errorlevel% NEQ 0 goto end
if %errorlevel% NEQ 0 goto error

if "%~1" == "" (
call :BuildSharpmake "Sharpmake.sln" "Debug" "Any CPU"
) else (
call :BuildSharpmake %1 %2 %3
)
goto end

if %errorlevel% NEQ 0 goto error

goto success

@REM -----------------------------------------------------------------------
:: Build Sharpmake using specified arguments
:BuildSharpmake
echo Compiling %~1 in "%~2|%~3"...

set MSBUILD_CMD=msbuild -t:build -restore "%~1" /nologo /verbosity:quiet /p:Configuration="%~2" /p:Platform="%~3"
set MSBUILD_CMD=msbuild -t:build -restore "%~1" /nologo /verbosity:m /p:Configuration="%~2" /p:Platform="%~3"
echo %MSBUILD_CMD%
%MSBUILD_CMD%
if %errorlevel% NEQ 0 (
set ERROR_CODE=%errorlevel%
if %ERROR_CODE% NEQ 0 (
echo ERROR: Failed to compile %~1 in "%~2|%~3".
exit /b 1
goto end
)
exit /b 0
goto success

:: End of batch file
@REM -----------------------------------------------------------------------
:success
COLOR 2F
set ERROR_CODE=0
goto end

@REM -----------------------------------------------------------------------
:error
COLOR 4F
set ERROR_CODE=1
goto end

@REM -----------------------------------------------------------------------
:end
:: restore caller current directory
popd

exit /b %ERROR_CODE%
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Sharpmake

[![Build status](https://ci.appveyor.com/api/projects/status/5y9eug3x9j078x6i?svg=true)](https://ci.appveyor.com/project/belkiss/sharpmake-36817)
![build](https://github.com/ubisoft/Sharpmake/workflows/build/badge.svg)

## Introduction
Sharpmake is a generator for Visual Studio projects and solutions. It is
Expand Down Expand Up @@ -79,7 +79,7 @@ functionality

used toolset for functional tests:

tools\FastBuild\FBuild.exe (win x64) and FBuild (osx x64) - v1.01. http://www.fastbuild.org
tools\FastBuild - v1.01. http://www.fastbuild.org



Expand Down
24 changes: 16 additions & 8 deletions Sharpmake.Application/CommandLineArguments.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2017 Ubisoft Entertainment
// Copyright (c) 2017-2021 Ubisoft Entertainment
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -57,18 +57,19 @@ public enum InputType
public bool SkipInvalidPath = false;
public bool DebugLog = false;
public bool Debug = false;
public bool DebugScripts = false;
public bool Diagnostics = false;
public bool WriteFiles = true;
public bool DumpDependency = false;
private bool _testOptionValid = true;
public bool ProfileOutput = false;
internal TestOptions TestOption;
internal bool RegressionDiff = true;
public DirectoryInfo OutputDirectory;
public DirectoryInfo ReferenceDirectory;
public DirectoryInfo RemapRoot;
public string MutexSuffix = string.Empty;
public bool GenerateDebugSolution = false;
public bool GenerateDebugSolutionOnly = false;
public string DebugSolutionStartArguments = string.Empty;

[CommandLine.Option("sources", @"sharpmake sources files: ex: /sources( ""project1.sharpmake"", ""..\..\project2.sharpmake"" )")]
Expand Down Expand Up @@ -157,12 +158,6 @@ public void CommandLineDebugLog(bool value)
DebugLog = value;
}

[CommandLine.Option("profileoutput", @"Write profiling information ( slow ): ex: /profileoutput(<true|false>)")]
public void CommandLineProfileOutput(bool value)
{
ProfileOutput = value;
}

[CommandLine.Option("diagnostics", @"Output more errors and warnings (slow): ex: /diagnostics")]
public void CommandLineDiagnostics()
{
Expand All @@ -175,6 +170,12 @@ public void CommandLineDebug()
Debug = true;
}

[CommandLine.Option("debugscripts", @"Compile scripts in debug to ease their debuggging: ex: /debugscripts")]
public void CommandLineDebugScripts()
{
DebugScripts = true;
}

[CommandLine.Option("sharpmakemutexsuffix", @"Allow custom mutex name suffix. Useful to debug concurrently multiple sharpmake running from different branches. Ex: /sharpmakemutexsuffix(""Name"")")]
public void CommandLineSharpmakeMutexSuffix(string name)
{
Expand Down Expand Up @@ -338,6 +339,13 @@ public void CommandLineDebugSolutionStartArguments(string arguments)
DebugSolutionStartArguments = arguments;
}

[CommandLine.Option("generateDebugSolutionOnly", @"Generate debug solution only (don't generate solution/project from user code).: /generateDebugSolutionOnly")]
public void CommandLineGenerateDebugSolutionOnly()
{
CommandLineGenerateDebugSolution();
GenerateDebugSolutionOnly = true;
}

[CommandLine.Option("forcecleanup", @"Path to an autocleanup db.
If this is set, all the files listed in the DB will be removed, and sharpmake will exit.
ex: /forcecleanup( ""tmp/sharpmakeautocleanupdb.bin"" ")]
Expand Down
24 changes: 15 additions & 9 deletions Sharpmake.Application/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2017 Ubisoft Entertainment
// Copyright (c) 2017-2021 Ubisoft Entertainment
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -18,6 +18,7 @@
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
using Sharpmake.Generators;
Expand Down Expand Up @@ -192,16 +193,20 @@ private static int Main()
if (DebugEnable && informationalVersion != null)
versionString += " " + informationalVersion;
}

LogWriteLine($"sharpmake {versionString}");
LogWriteLine(" arguments : {0}", CommandLine.GetProgramCommandLine());
LogWriteLine(" directory : {0}", Directory.GetCurrentDirectory());
LogWriteLine(" arguments: {0}", CommandLine.GetProgramCommandLine());
LogWriteLine(" directory: {0}", Directory.GetCurrentDirectory());
LogWriteLine(" platform: {0} - {1}", Util.GetExecutingPlatform().ToString(), RuntimeInformation.OSDescription);
LogWriteLine(" compiled with framework: {0}", Util.FrameworkDisplayName());
LogWriteLine(" running on framework: {0}", RuntimeInformation.FrameworkDescription);
LogWriteLine(string.Empty);

// display help if wanted and quit
if ((CommandLine.GetProgramCommandLine().Length == 0) || CommandLine.ContainParameter("help"))
{
LogWriteLine(CommandLine.GetCommandLineHelp(typeof(Argument), false));
return (int)ExitCode.Success;
return CommandLine.ContainParameter("help") ? (int)ExitCode.Success : (int)ExitCode.Error;
}

AppDomain.CurrentDomain.AssemblyLoad += AppDomain_AssemblyLoad;
Expand Down Expand Up @@ -430,7 +435,7 @@ private static void LogSharpmakeExtensionLoaded(Assembly extensionAssembly)

private static void CreateBuilderAndGenerate(BuildContext.BaseBuildContext buildContext, Argument parameters, bool generateDebugSolution)
{
using (Builder builder = CreateBuilder(buildContext, parameters, true, generateDebugSolution))
using (Builder builder = CreateBuilder(buildContext, parameters, allowCleanBlobs: true, generateDebugSolution: generateDebugSolution))
{
if (parameters.CleanBlobsOnly)
{
Expand Down Expand Up @@ -478,7 +483,10 @@ private static void GenerateAll(BuildContext.BaseBuildContext buildContext, Argu
ExtensionMethods.ClearVisualStudioDirCaches();
}

CreateBuilderAndGenerate(buildContext, parameters, generateDebugSolution: false);
if (!parameters.GenerateDebugSolutionOnly)
{
CreateBuilderAndGenerate(buildContext, parameters, generateDebugSolution: false);
}
}

private static ExitCode AnalyzeConfigureOrder(Argument parameters, bool stopOnFirstError)
Expand Down Expand Up @@ -588,6 +596,7 @@ public static Builder CreateBuilder(BuildContext.BaseBuildContext context, Argum
parameters.BlobOnly,
parameters.SkipInvalidPath,
parameters.Diagnostics,
parameters.DebugScripts,
Program.GetGeneratorsManager,
parameters.Defines
);
Expand All @@ -598,9 +607,6 @@ public static Builder CreateBuilder(BuildContext.BaseBuildContext context, Argum
builder.EventOutputMessage += LogWrite;
builder.EventOutputDebug += DebugWrite;

if (parameters.ProfileOutput)
builder.EventOutputProfile += LogWrite;

if (!string.IsNullOrEmpty(parameters.ProfileFile))
builder.EnableProfiling();

Expand Down
4 changes: 2 additions & 2 deletions Sharpmake.Application/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2017 Ubisoft Entertainment
// Copyright (c) 2017, 2019-2020 Ubisoft Entertainment
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -43,4 +43,4 @@
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("0.14.6.0")]
[assembly: AssemblyVersion("0.15.0.0")]
Loading

0 comments on commit 1775159

Please sign in to comment.