merger

package
v0.7.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2017 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package merger provides methods for merging parsed BUILD files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FixFile added in v0.5.3

func FixFile(c *config.Config, oldFile *bf.File) *bf.File

FixFile updates rules in oldFile that were generated by an older version of Gazelle to a newer form that can be merged with freshly generated rules.

FixLoads should be called after this, since it will fix load statements that may be broken by transformations applied by this function.

func FixFileMinor added in v0.7.1

func FixFileMinor(c *config.Config, oldFile *bf.File) *bf.File

FixFileMinor updates rules in oldFile that were generated by an older version of Gazelle to a newer form that can be merged with freshly generated rules.

FixFileMinor includes only small, low-risk fixes that can be applied in update mode. When both FixFileMinor and FixFile are called, FixFileMinor should be called first.

FixLoads should be called after this, since it will fix load statements that may be broken by transformations applied by this function.

func FixLoads added in v0.6.0

func FixLoads(oldFile *bf.File) *bf.File

FixLoads removes loads of unused go rules and adds loads of newly used rules. This should be called after FixFile and MergeWithExisting, since symbols may be introduced that aren't loaded.

func MergeWithExisting

func MergeWithExisting(genFile, oldFile *bf.File, empty []bf.Expr) *bf.File

MergeWithExisting merges "genFile" with "oldFile" and returns the merged file.

"genFile" is a file generated by Gazelle. It must not be nil. "oldFile" is the existing file. It may be nil if no file was found. "empty" is a list of rules that may be deleted.

If "oldFile" is nil, "genFile" will be returned. If "oldFile" contains a "# gazelle:ignore" comment, nil will be returned. If an error occurs, it will be logged, and nil will be returned.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL