本文整理汇总了Golang中github.com/hwaf/hwaf/hlib.Target_t.Source方法的典型用法代码示例。如果您正苦于以下问题:Golang Target_t.Source方法的具体用法?Golang Target_t.Source怎么用?Golang Target_t.Source使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/hwaf/hwaf/hlib.Target_t
的用法示例。
在下文中一共展示了Target_t.Source方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: cnv_tdaq_install_scripts
func cnv_tdaq_install_scripts(wscript *hlib.Wscript_t, stmt Stmt) error {
pkgname := filepath.Base(wscript.Package.Name)
tgt := hlib.Target_t{Name: pkgname + "-install-scripts"}
tgt.Features = []string{"tdaq_install_scripts"}
tgt.Source = []hlib.Value{hlib.DefaultValue(
"script-files",
[]string{"scripts/*"},
)}
wscript.Build.Targets = append(wscript.Build.Targets, tgt)
return nil
}
示例2: cnv_atlas_install_data
func cnv_atlas_install_data(wscript *hlib.Wscript_t, stmt Stmt) error {
//x := stmt.(*ApplyPattern)
//fmt.Printf(">>> [%s] \n", x.Name)
pkgname := filepath.Base(wscript.Package.Name)
tgt := hlib.Target_t{Name: pkgname + "-install-data"}
tgt.Features = []string{"atlas_install_data"}
tgt.Source = []hlib.Value{hlib.DefaultValue(
"data-files",
[]string{"data/*"},
)}
wscript.Build.Targets = append(wscript.Build.Targets, tgt)
return nil
}
示例3: analyze
func (r *Renderer) analyze() error {
var err error
basedir := filepath.Dir(filepath.Dir(r.req.Filename))
r.pkg = hlib.Wscript_t{
Package: hlib.Package_t{Name: basedir},
Configure: hlib.Configure_t{Env: make(hlib.Env_t)},
Build: hlib.Build_t{Env: make(hlib.Env_t)},
}
wscript := &r.pkg
// targets
apps := make(map[string]*Application)
libs := make(map[string]*Library)
// first pass: discover targets
for _, stmt := range r.req.Stmts {
switch stmt.(type) {
case *Application:
x := stmt.(*Application)
apps[x.Name] = x
case *Library:
x := stmt.(*Library)
libs[x.Name] = x
}
}
// list of macros related to targets.
// this will be used to:
// - fold them together
// - pre-process macro_append, macro_remove, ...
// - dispatch to wscript equivalents. e.g.:
// - <name>linkopts -> ctx(use=[...], cxxshlibflags=[...])
// - <name>_dependencies -> ctx(depends_on=[...])
// - includes -> ctx(includes=[..])
macros := make(map[string][]Stmt)
tgt_names := make([]string, 0, len(apps)+len(libs))
for k, _ := range apps {
tgt_names = append(tgt_names, k)
}
for k, _ := range libs {
tgt_names = append(tgt_names, k)
}
sort.Strings(tgt_names)
//fmt.Printf("+++ tgt_names: %v\n", tgt_names)
// second pass: collect macros
for _, stmt := range r.req.Stmts {
switch x := stmt.(type) {
default:
continue
case *Macro:
//fmt.Printf("== [%s] ==\n", x.Name)
//pat := x.Name+"(_dependencies|linkopts)"
pat := ".*?"
if !re_is_in_slice_suffix(tgt_names, x.Name, pat) {
continue
}
macros[x.Name] = append(macros[x.Name], x)
case *MacroAppend:
pat := ".*?"
if !re_is_in_slice_suffix(tgt_names, x.Name, pat) {
continue
}
macros[x.Name] = append(macros[x.Name], x)
case *MacroRemove:
pat := ".*?"
if !re_is_in_slice_suffix(tgt_names, x.Name, pat) {
continue
}
macros[x.Name] = append(macros[x.Name], x)
}
}
// models private/public, end_private/end_public
ctx_visible := []bool{true}
// 3rd pass: collect libraries and apps
// this is to make sure the profile-converters get them already populated
for _, stmt := range r.req.Stmts {
wbld := &wscript.Build
switch x := stmt.(type) {
case *Library:
tgt := hlib.Target_t{Name: x.Name}
srcs, rest := sanitize_srcs(x.Source, "src")
// FIXME: handle -s=some/dir
if len(rest) > 0 {
}
val := hlib.Value{
Name: x.Name,
Set: []hlib.KeyValue{
{Tag: "default", Value: srcs},
},
//.........这里部分代码省略.........