本文整理匯總了Golang中github.com/getgauge/gauge/manifest.Manifest類的典型用法代碼示例。如果您正苦於以下問題:Golang Manifest類的具體用法?Golang Manifest怎麽用?Golang Manifest使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了Manifest類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: addPluginToTheProject
func addPluginToTheProject(pluginName string, pluginArgs map[string]string, manifest *manifest.Manifest) error {
if !plugin.IsPluginInstalled(pluginName, pluginArgs["version"]) {
logger.Log.Info("Plugin %s %s is not installed. Downloading the plugin.... \n", pluginName, pluginArgs["version"])
result := InstallPlugin(pluginName, pluginArgs["version"])
if !result.Success {
logger.Log.Error(result.getMessage())
}
}
pd, err := plugin.GetPluginDescriptor(pluginName, pluginArgs["version"])
if err != nil {
return err
}
if plugin.IsPluginAdded(manifest, pd) {
logger.Log.Info("Plugin " + pd.Name + " is already added.")
return nil
}
action := setupScope
if err := plugin.SetEnvForPlugin(action, pd, manifest, pluginArgs); err != nil {
return err
}
if _, err := plugin.StartPlugin(pd, action, true); err != nil {
return err
}
manifest.Plugins = append(manifest.Plugins, pd.Id)
return manifest.Save()
}
示例2: addPluginToTheProject
func addPluginToTheProject(pluginName string, pluginArgs map[string]string, manifest *manifest.Manifest) error {
if !plugin.IsPluginInstalled(pluginName, pluginArgs["version"]) {
logger.Info("Plugin %s %s is not installed. Downloading the plugin.... \n", pluginName, pluginArgs["version"])
result := InstallPlugin(pluginName, pluginArgs["version"])
if !result.Success {
logger.Error(result.getMessage())
}
}
pd, err := plugin.GetPluginDescriptor(pluginName, pluginArgs["version"])
if err != nil {
return err
}
if plugin.IsPluginAdded(manifest, pd) {
return fmt.Errorf("Plugin %s is already added.", pd.Name)
}
manifest.Plugins = append(manifest.Plugins, pd.Id)
return manifest.Save()
}