early-access version 3088

This commit is contained in:
pineappleEA
2022-11-05 15:35:56 +01:00
parent 4e4fc25ce3
commit b601909c6d
35519 changed files with 5996896 additions and 860 deletions

View File

@@ -0,0 +1,11 @@
# Copyright 2007 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
This example shows the 'generate' rule, that allows you to construct target
using any arbitrary set of transformation and commands.
The rule is similar to 'make' and 'notfile', but unlike those, you can operate
in terms of B2 'virtual targets', which is more flexible.
Please consult the docs for more explanations.

View File

@@ -0,0 +1,10 @@
int main()
{
}
/*
Copyright 2007 Vladimir Prus
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE.txt or https://www.bfgroup.xyz/b2/LICENSE.txt)
*/

View File

@@ -0,0 +1,26 @@
import "class" : new ;
import common ;
rule generate-example ( project name : property-set : sources * )
{
local result ;
for local s in $(sources)
{
#local source-name = [ $(s).name ] ;
#local source-action = [ $(s).action ] ;
#local source-properties = [ $(source-action).properties ] ;
# Create a new action, that takes the source target and runs the
# 'common.copy' command on it.
local a = [ new non-scanning-action $(s) : common.copy : $(property-set)
] ;
# Create a target to represent the action result. Uses the target name
# passed here via the 'name' parameter and the same type and project as
# the source.
result += [ new file-target $(name) : [ $(s).type ] : $(project) : $(a)
] ;
}
return $(result) ;
}

View File

@@ -0,0 +1,16 @@
from b2.build.virtual_target import NonScanningAction, FileTarget
def generate_example(project, name, ps, sources):
result = []
for s in sources:
a = NonScanningAction([s], "common.copy", ps)
# Create a target to represent the action result. Uses the target name
# passed here via the 'name' parameter and the same type and project as
# the source.
result.append(FileTarget(name, s.type(), project, a))
return result

View File

@@ -0,0 +1,9 @@
# Copyright 2007 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE.txt or https://www.bfgroup.xyz/b2/LICENSE.txt)
import generate ;
import gen ;
generate a2 : a.cpp : <generating-rule>@gen.generate-example ;