Code Monkey home page Code Monkey logo

sourcecompiler's Introduction

SourceCompiler

A smart API to compile multiple .NET projects for extremely large solutions. It analyse the references and order the projects by build priority. After, they can be built.

It handle circular references and can show somes reports :

Reference Depth : 
ProjectA, Version=1.0.0.0 - Priority : 1
ProjectB, Version=1.0.0.0 - Priority : 2
ProjectC, Version=1.0.0.0 - Priority : 3

C# exemples


Build sources in a two step process for performance
var engine = new Microsoft.Build.BuildEngine.Engine();
engine.GlobalProperties.SetProperty("Configuration", "Debug");
engine.GlobalProperties.SetProperty("Platform", "AnyCPU");

//Step 1 : Analyse build priorities (Required only the first time when using cache)
var sources = new SourceCompiler.SourceAnalyser(engine);
sources.AnalyseInputs(new string[]{"C:\solution.sln","C:\folderWithProjects", "C:\project.vbproj"});
sources.ApplyBuildsPriority();
sources.SaveCache(cacheFile);

//Step 2 : Build
var builder = new SourceBuilder(engine);
builder.LoadCache(cacheFile);
builder.BuildAllProject();
Build sources in a one step process (without cache)
var engine = new Microsoft.Build.BuildEngine.Engine();
engine.GlobalProperties.SetProperty("Configuration", "Debug");
engine.GlobalProperties.SetProperty("Platform", "AnyCPU");

//Step 1 : Analyse build priorities
var sources = new SourceCompiler.SourceAnalyser(engine);
sources.AnalyseInputs(new string[]{"C:\solution.sln","C:\folderWithProjects", "C:\project.vbproj"});
sources.ApplyBuildsPriority();

//Step 2 : Build
var builder = new SourceBuilder(engine);
builder.AllAssenblies = sources.AllAssenblies;
builder.BuildAllProject();

Command line exemples


Build opened solution with a batch file as external tool within Visual Studio
@echo off
REM Param 1 : $(SolutionDir) 
REM Param 2 : $(SolutionDir)$(SolutionFileName)
echo Build started
%~dp0\SourceCompiler.exe %1\sln.sc -a %2 -v 0
%~dp0\SourceCompiler.exe %1\sln.sc -b --StopBuildingOnFailure
del %1\sln.sc
Build all projects from a folder
@echo off
echo Build started
SourceCompiler.exe C:\Sources\Projects\cache.sc -a C:\Sources\Projects -v 3
SourceCompiler.exe C:\Sources\Projects\cache.sc -b
echo Build completed
pause

sourcecompiler's People

Contributors

adampaquette avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.