• Stars
    star
    907
  • Rank 50,358 (Top 1.0 %)
  • Language
    C#
  • License
    MIT License
  • Created over 7 years ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A cross platform build and deployment automation system for building projects and executing deployment scripts using C# code.

English | 中文

FlubuCore

Build Status NuGet Badge Gitter Member project of .NET Foundation Member project of .NET Core Community License

Introduction

"FlubuCore - Fluent Builder Core" is a cross platform build and deployment automation system. You can define your build and deployment scripts in C# using an intuitive fluent interface. This gives you code completion, IntelliSense, debugging, FlubuCore custom analyzers, and native access to the whole .NET ecosystem inside of your scripts.

FlubuCore in action

FlubuCore offers a .net (core) console application that uses power of roslyn to compile and execute scripts. Above example can be run from console with:

  • FlubuCore runner (.NET 4.62+) flubu.exe Default
  • FlubuCore dotnet cli tool (.NET Core 1.0+) dotnet flubu Default
  • FlubuCore local or global tool (.NET Core 2.1+) flubu Default

Features and Advantages

  • Intuitive an easy to learn. C#, fluent interface, and IntelliSense make even most complex script creation a breeze.
    [FromArg("nugetKey", "Nuget api key for publishing Flubu nuget packages.")]
    public string NugetApiKey { get; set; }

    protected override void ConfigureTargets(ITaskContext context)
    {
        var pack = context.CreateTarget("Pack")
            .SetDescription("Prepare's nuget package.")
            .AddCoreTask(x => x.Pack()
                .NoBuild()
                .OutputDirectory(OutputDirectory)
                .WithArguments("--force")); //you can add your own custom arguments on each task

        var branch = context.BuildSystems().Travis().Branch;
       
        var nugetPush = context.CreateTarget("Nuget.publish")
            .SetDescription("Publishes nuget package.")
            .DependsOn(pack)
            .AddCoreTask(x => x.NugetPush($"{OutputDirectory}/NetCoreOpenSource.nupkg")
                .ServerUrl("https://www.nuget.org/api/v2/package")
                .ApiKey(NugetApiKey)
            )
            .When(c => c.BuildSystems().RunningOn == BuildSystemType.TravisCI
                        && !string.IsNullOrEmpty(branch)
                        && branch.EndsWith("stable", StringComparison.OrdinalIgnoreCase));
    }
  • Large number of often used built-in tasks like e.g. versioning, running tests, creating deployment packages, publishing NuGet packages, docker tasks, git tasts, sql tasks, npm tasks, executing PowerShell, managing IIS scripts and many more.
context.CreateTarget("build")
   .AddTask(x => x.GitVersionTask())
   .AddTask(x => x.CompileSolutionTask("MySolution.sln").BuildConfiguration("Release");

context.CreateTarget("run.tests")
   .AddTask(x => x.XunitTaskByProjectName("MyProject").StopOnFail())
   .AddTask(x => x.NUnitTask(NunitCmdOptions.V3, "MyProject2").ExcludeCategory("Linux"))
   .AddCoreTask(x => x.CoverletTask("MyProject.dll"));
context.CreateTarget("DoExample")
        .Do(c =>
        {
            // write your awesome code.
            File.Copy("NotSoAwesome.txt", Path.Combine(OutputDirectory, "JustAnExample.txt") );
            // Access flubu built in tasks in DO if needed.
            c.Tasks().GenerateT4Template("example.TT").Execute(c);                
        })
        .AddTask(x => x.CompileSolutionTask())
        .Do(NuGetPackageReferencingExample);
[NugetPackage("Newtonsoft.json", "11.0.2")]
[Assembly(".\Lib\EntityFramework.dll")]
public class BuildScript : DefaultBuildScript
{
   public void NuGetPackageReferencingExample(ITaskContext context)
    {
        JsonConvert.SerializeObject("Example");
    }
}
context.CreateTarget("Run.Libz")
    .AddTask(x => x.RunProgramTask(@"packages\LibZ.Tool\1.2.0\tools\libz.exe")
        .WorkingFolder(@".\src")
        .WithArguments("add")
        .WithArguments("--libz", "Assemblies.libz"));
public class SimpleScript : DefaultBuildScript
{
   [FromArg("c", "The configuration to use for building the project.")]
   public string Configuration { get; set; } = "Release"
 
   [FromArg("sn", "If true app is deployed on second node. Otherwise not.")]
   public bool deployOnSecondNode { get; set; }

   protected override void ConfigureTargets(ITaskContext context)
   {
        context.CreateTarget("build")
           .AddCoreTask(x => x.Build()
               .Configuration(Configuration)
               .ForMember(x =>  x.Framework("net462"), "f", "The target framework to build for.")); 
   }
}
 flubu build -c=Debug -f=netcoreapp2.0

FlubuCore interactive mode

FlubuCore analyzers in action

Getting Started

Using FlubuCore is straightforward and very simple :-) It is also fully and throughly documented.

The Getting Started chapter in FlubuCore Documentation will help you set up your first FlubuCore build in no time. You should also check getting started blog. It has some more details with some nice tips and tricks.

A comprehensive list of features that FlubuCore has to offer with descriptions can be found in the Build Script Fundamentals chapter.

Once you have your build and deployment scripts defined, the following Wiki chapters will explain how to run them:

Examples

Aside from the detailed Wiki FlubuCore comes with example projects that reflect real-life situations. The examples can be found in the separate Examples repository.

These examples will help you to get quickly start with FlubuCore:

  • .NET Framework build example - Example covers versioning, building the project, running tests, packaging application for deployment and some other basic use cases.

  • .NET Core build example - Example covers versioning, building the project, running tests, packaging application for deployment and some other basic use cases.

  • Deployment script example - Example shows how to write simple deployment script.

  • Open source library example - Example covers versioning, building the project, running tests and publishing nuget package. It also covers how to run build script on Appveyor and Travis CI.

Have a question?

Join the chat at https://gitter.im/FlubuCore/Lobby

Contributing

Please see CONTRIBUTING.md.

Ways to Contribute

  • We appreciate deeply any feedback that you may have! Feel free to participate in the chat, or add an issue in the issue tracker.
  • Spread the word about the project.
  • If you like the project don't forget to give it a star so that the community get's bigger.
  • Improve documentation.
  • Report, fix a bug.
  • Implement a new feature.
  • Discuss potential ways to improve project.
  • Improve existing implementation, performance, etc.

Changelog and Roadmap

Changes with description and examples can be found in Changelog

You can see FlubuCore roadmap by exploring opened Milestones.

Further Development

If you find FlubuCore useful (you feel it helps you on the daily basis) you can support further development by buying us a coffee (or become a backer or sponsor). Sometimes it's hard to stay awake till midnight implementing new features, coffee helps us with that. We would really appreciate your support. Money from sponsorship will also be used for the promotion of the project. If you are a backer or a sponsor you can also request for a new feature or ask for support. These issues will be handled with highest priority.

Backers and Sponsors

OpenCollective OpenCollective

Used & Powered by

Thank's to Comtrade for supporting us.

FlubuCore analyzers in action

Acknowledgements

  • Special thanks to @ironcev for greatly improving readme and for giving some valuable advices.
  • Special thanks to @alexinea for translating whole documentation to Chinese.
  • Special thanks to @huanlin for writing blogs about FlubuCore in Traditional Chinese and for translating them to English.

Code of Conduct

This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community. For more information see the .NET Foundation Code of Conduct.

.NET Foundation

This project is supported by the .NET Foundation.

More Repositories

1

FastGithub

github加速神器,解决github打不开、用户头像无法加载、releases无法上传下载、git-clone、git-pull、git-push失败等问题
C#
13,273
star
2

CAP

Distributed transaction solution in micro-service base on eventually consistency, also an eventbus with Outbox pattern
C#
6,267
star
3

Util

Util是一个.Net平台下的应用框架,旨在提升中小团队的开发能力,由工具类、分层架构基类、Ui组件,配套代码生成模板,权限等组成。
C#
4,306
star
4

WTM

Use WTM to write .netcore app fast !!!
C#
4,234
star
5

FreeSql

🦄 .NET aot orm, C# orm, VB.NET orm, Mysql orm, Postgresql orm, SqlServer orm, Oracle orm, Sqlite orm, Firebird orm, 达梦 orm, 人大金仓 orm, 神通 orm, 翰高 orm, 南大通用 orm, 虚谷 orm, 国产 orm, Clickhouse orm, QuestDB orm, MsAccess orm.
C#
4,071
star
6

DotnetSpider

DotnetSpider, a .NET standard web crawling library. It is lightweight, efficient and fast high-level web crawling & scraping framework
C#
3,753
star
7

osharp

OSharp是一个基于.Net6.0的快速开发框架,框架对 AspNetCore 的配置、依赖注入、日志、缓存、实体框架、Mvc(WebApi)、身份认证、功能权限、数据权限等模块进行更高一级的自动化封装,并规范了一套业务实现的代码结构与操作流程,使 .Net 框架更易于应用到实际项目开发中。
C#
2,758
star
8

BootstrapBlazor

Bootstrap Blazor is an enterprise-level UI component library based on Bootstrap and Blazor.
C#
2,492
star
9

Magicodes.IE

Import and export general library, support Dto import and export, template export, fancy export and dynamic export, support Excel, Csv, Word, Pdf and Html.
C#
2,074
star
10

WebApiClient

A REST API library with better functionality, performance, and scalability than refit
C#
2,047
star
11

NPOI

A .NET library for reading and writing Microsoft Office binary and OOXML file formats.
C#
1,877
star
12

EasyCaching

💥 EasyCaching is an open source caching library that contains basic usages and some advanced usages of caching which can help us to handle caching more easier!
C#
1,736
star
13

AspectCore-Framework

AspectCore is an AOP-based cross platform framework for .NET Standard.
C#
1,684
star
14

AgileConfig

基于.NET Core开发的轻量级分布式配置中心 / .NET Core lightweight configuration server
C#
1,483
star
15

Natasha

基于 Roslyn 的 C# 动态程序集构建库,该库允许开发者在运行时使用 C# 代码构建域 / 程序集 / 类 / 结构体 / 枚举 / 接口 / 方法等,使得程序在运行的时候可以增加新的模块及功能。Natasha 集成了域管理/插件管理,可以实现域隔离,域卸载,热拔插等功能。 该库遵循完整的编译流程,提供完整的错误提示, 可自动添加引用,完善的数据结构构建模板让开发者只专注于程序集脚本的编写,兼容 stanadard2.0 / netcoreapp3.0+, 跨平台,统一、简便的链式 API。 且我们会尽快修复您的问题及回复您的 issue.
C#
1,449
star
16

HttpReports

HttpReports is an APM (application performance monitor) system for .Net Core.
C#
1,260
star
17

sharding-core

high performance lightweight solution for efcore sharding table and sharding database support read-write-separation .一款ef-core下高性能、轻量级针对分表分库读写分离的解决方案,具有零依赖、零学习成本、零业务代码入侵
C#
1,142
star
18

SmartSql

SmartSql = MyBatis in C# + .NET Core+ Cache(Memory | Redis) + R/W Splitting + PropertyChangedTrack +Dynamic Repository + InvokeSync + Diagnostics
C#
1,098
star
19

Alipay.AopSdk.Core

支付宝(Alipay)服务端SDK,采用.NET Standard 2.0,支持.NET Core >=2.0,与官方SDK接口完全相同。完全可以按照官方文档进行开发。除了支持支付以外,官方SDK支持的功能本SDK全部支持,比如生活号、服务窗、行业合作等,且用法几乎一样,代码都可参考官方文档代码。
C#
778
star
20

SmartCode

SmartCode = IDataSource -> IBuildTask -> IOutput => Build Everything!!!
C#
572
star
21

CanalSharp

Alibaba mysql database binlog subscription & consumer components Canal's .NET client.
C#
559
star
22

aspnetcore-doc-cn

The Simplified Chinese edition of Microsoft ASP.NET Core documentation, translated by .NET Core Community and .NET China Community.
C#
521
star
23

Home

Home repo of .NET Core Community
299
star
24

mocha

Mocha is an application performance monitor tools based on OpenTelemetry, which also provides a scalable platform for observability data analysis and storage.
C#
142
star
25

Collections

Utilities and extensions for Collections includes Collections.Paginable and so on...
C#
88
star
26

EntityFrameworkCore.KingbaseES

Entity Framework Core provider for KingbaseES Database
C#
45
star
27

EntityFrameworkCore.GaussDB

Entity Framework Core provider for GaussDB Database
C#
32
star
28

FlubuCore.Examples

Examples for FlubuCore - a cross platform build automation tool for building projects and executing deployment scripts using C# code.
C#
32
star
29

wind-rises

25
star
30

Compile.Environment

When using the Roslyn library for dynamic compilation, you can introduce the library to provide a dynamic compilation environment.
10
star
31

SourceLink.Environment

Provide an inheritable NuGet package for the SourceLink feature.
7
star
32

projects

This repository is the site of NCC Projects include both Top-Level projects and Sandbox projects.
CSS
5
star
33

Natasha.Docs

The document for Natasha
JavaScript
4
star
34

DotNetCore.GaussDB

It's the foundation of DotNetCore.EntityFrameworkCore.GaussDB
C#
3
star
35

dotnetcore.github.io

.NET Core Community Official WebSite
HTML
2
star