qtpm

package
v0.8.8 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2017 License: MIT Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	QTPMVersion       = []int{0, 8, 8}
	QTPMVersionString = fmt.Sprintf("%d.%d.%d", QTPMVersion[0], QTPMVersion[1], QTPMVersion[2])
)
View Source
var Verbose bool

Functions

func AddClass

func AddClass(config *PackageConfig, name string)

func AddDotGitIgnore

func AddDotGitIgnore(config *PackageConfig)

func AddLicense

func AddLicense(config *PackageConfig, name string)

func AddQtModule

func AddQtModule(config *PackageConfig, module string)

func AddTest

func AddTest(config *PackageConfig, name string)

func Asset

func Asset(name string) ([]byte, error)

Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetDir

func AssetDir(name string) ([]string, error)

AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:

data/
  foo.txt
  img/
    a.png
    b.png

then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.

func AssetInfo

func AssetInfo(name string) (os.FileInfo, error)

AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetNames

func AssetNames() []string

AssetNames returns the names of the assets.

func Build

func Build(refresh bool, buildType BuildType)

func BuildFolder

func BuildFolder(buildType BuildType) string

func BuildOptions

func BuildOptions(defaultOption, compileCommand string, path string) []string

func CMakeOptions

func CMakeOptions(qtDir string) []string

func Clean

func Clean()

func CleanList

func CleanList(modules []string) []string

func CleanName

func CleanName(name string) string

func CopyFile

func CopyFile(src, dst string) (err error)

func CreateIcon

func CreateIcon(rootPackageDir string, buildType BuildType)

func CreateResource

func CreateResource(rootPackageDir string) bool

func Doc

func Doc()

func DownloadZip

func DownloadZip(installDir, orgName, repoName string) error

func Env

func Env(vars []string)

func FileCopy added in v0.8.8

func FileCopy(dest, source string) error

func FindQt

func FindQt(dir string) string

func FindWix added in v0.8.7

func FindWix() string

func Format

func Format(targetFiles []string)

func Get

func Get(packageName string, update, useGit bool)

func GetCompileCommand

func GetCompileCommand(dir string) map[string]string

func GetDefaultIncludeOptions

func GetDefaultIncludeOptions(dir string) string

func GetLangFromTSFile

func GetLangFromTSFile(filename string) string

func InitApplication

func InitApplication(name, license string)

func InitLibrary

func InitLibrary(name, license string)

func LinguistAdd

func LinguistAdd(language string, update bool)

func LinguistEdit

func LinguistEdit(language string)

func LinguistUpdate

func LinguistUpdate()

func MustAsset

func MustAsset(name string) []byte

MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.

func NormalizeLicense

func NormalizeLicense(licenseName string) (string, string, error)

func OldestUnixTime

func OldestUnixTime(paths ...string) int64

func Pack

func Pack(buildType BuildType, zipPack, wixPack bool)

func ParseName

func ParseName(name string) (dirName, className, parentName string)

func PrintCommand

func PrintCommand(cmd *exec.Cmd, envs []string)

func ReleaseTranslation

func ReleaseTranslation(rootPackageDir, srcDir string) error

func RequiredQtModules

func RequiredQtModules(config *PackageConfig, dependencies []*PackageConfig) []string

func RestoreAsset

func RestoreAsset(dir, name string) error

RestoreAsset restores an asset under the given directory

func RestoreAssets

func RestoreAssets(dir, name string) error

RestoreAssets restores an asset under the given directory recursively

func Run

func Run(refresh bool, buildType BuildType)

func RunCMakeAndBuild

func RunCMakeAndBuild(rootPackageDir string, packageConfig *PackageConfig, buildType BuildType, update, build, install bool) error

func SequentialRun

func SequentialRun(workDir string) *sequentialRun

func SetUseWebAssemblyCompiler

func SetUseWebAssemblyCompiler(asmJS, webAsm bool)

func SetVerbose

func SetVerbose()

func SetupWebAssemblyTool

func SetupWebAssemblyTool(update bool)

func Test

func Test(refresh bool)

func TopologicalSort

func TopologicalSort(edges [][2]string) ([]string, [][2]string)

func Touch

func Touch(rootConfig *PackageConfig, buildType BuildType, verbose bool)

func UserName

func UserName() string

func Vet

func Vet(targetFiles []string)

func WriteLicense

func WriteLicense(dir, license string) error

func WriteTemplate

func WriteTemplate(basePath, dir, fileName, templateName string, variable interface{}, checkFileChange bool) (bool, error)

Types

type BuildType added in v0.8.4

type BuildType int
const (
	Debug BuildType = iota
	Release
	ReleaseWithDebug
	MinSizeRel
)

func BuildTypeFromString added in v0.8.4

func BuildTypeFromString(buildType string) BuildType

func (BuildType) CMakeFlag added in v0.8.4

func (t BuildType) CMakeFlag() string

func (BuildType) String added in v0.8.4

func (t BuildType) String() string

type Cmd

type Cmd struct {
	Silent bool
	// contains filtered or unexported fields
}

func CMake

func CMake(workDir string, generate bool, buildType BuildType, target string, buildArgs []string) *Cmd

func Command

func Command(command, workDir string, args ...string) *Cmd

func CommandWithPath added in v0.8.7

func CommandWithPath(command, workDir, path string, args ...string) *Cmd

func (*Cmd) AddEnv

func (c *Cmd) AddEnv(env ...string)

func (*Cmd) Run

func (c *Cmd) Run() error

type CompileCommand

type CompileCommand struct {
	Directory string `json:"directory"`
	Command   string `json:"command"`
	File      string `json:"file"`
}

type FilterType

type FilterType int
const (
	AllSource FilterType = iota
	NoHeaderFile
)

type InstallHeaderDir

type InstallHeaderDir struct {
	TargetDir string
	Files     *SourceBundle
}

type PackageConfig

type PackageConfig struct {
	Name             string                    `toml:"name"`
	Description      string                    `toml:"description"`
	Author           string                    `toml:"author"`
	Organization     string                    `toml:"organization"`
	License          string                    `toml:"license"`
	Requires         []string                  `toml:"requires"`
	QtModules        []string                  `toml:"qtmodules"`
	Version          []int                     `toml:"version"`
	ExtraInstallDirs []string                  `toml:"extra_install_dirs"`
	ProjectStartYear int                       `toml:"project_start_year"`
	QTPMVersion      []int                     `toml:"qtpm_version"`
	IsApplication    bool                      `toml:"-"`
	Dir              string                    `toml:"-"`
	PackageName      string                    `toml:"-"`
	Children         map[string]*PackageConfig `toml:"-"`
	DirtyFlag        bool                      `toml:"-"`
}

func FilterDependencies

func FilterDependencies(config *PackageConfig, allDependencies []*PackageConfig) []*PackageConfig

func LoadConfig

func LoadConfig(dir string, traverse bool) (*PackageConfig, error)

func MustLoadConfig

func MustLoadConfig(dir string, traverse bool) *PackageConfig

func (*PackageConfig) Save

func (config *PackageConfig) Save() error

func (*PackageConfig) SaveIfDirty

func (config *PackageConfig) SaveIfDirty() error

type PackageUserConfig

type PackageUserConfig struct {
	QtDir       string `toml:"qtdir"`
	BuildNumber int    `toml:"build_number"`
}

func LoadUserConfig

func LoadUserConfig(dirPatb string) (*PackageUserConfig, error)

type ProjectDetail

type ProjectDetail struct {
	Target              string
	Requires            []Require
	QtModules           []string
	AllDependencies     []string
	Sources             *SourceBundle
	InstallHeaderDirs   map[string]*SourceBundle
	Tests               *SourceBundle
	ExtraTestSources    *SourceBundle
	Examples            *SourceBundle
	ExtraExampleSources *SourceBundle
	Resources           *SourceBundle
	HasQtResource       bool
	SubDir              bool
	BuildNumber         int
	// contains filtered or unexported fields
}

func AddCMakeForApp

func AddCMakeForApp(config *PackageConfig, rootPackageDir string, dependencies []*PackageConfig, refresh bool, buildType BuildType) (bool, *ProjectDetail, error)

func AddCMakeForLib

func AddCMakeForLib(config *PackageConfig, rootPackageDir string, dependencies []*PackageConfig, refresh bool, buildType BuildType) (bool, *ProjectDetail, error)

func BuildPackage

func BuildPackage(rootConfig, config *PackageConfig, buildType BuildType, refresh, build, install bool) (*ProjectDetail, error)

func (*ProjectDetail) AllFiles

func (pd *ProjectDetail) AllFiles(isApplication bool, filter FilterType) []string

func (ProjectDetail) AuthorName

func (sv ProjectDetail) AuthorName() string

func (ProjectDetail) CopyRight

func (sv ProjectDetail) CopyRight() string

func (ProjectDetail) Description

func (sv ProjectDetail) Description() string

func (ProjectDetail) InstallHeaders

func (sv ProjectDetail) InstallHeaders() []*InstallHeaderDir

func (ProjectDetail) LicenseName

func (sv ProjectDetail) LicenseName() string

func (ProjectDetail) Organization

func (sv ProjectDetail) Organization() string

func (ProjectDetail) RequireLibs

func (sv ProjectDetail) RequireLibs() string

func (*ProjectDetail) SearchFiles

func (sv *ProjectDetail) SearchFiles()

func (ProjectDetail) ShortVersion

func (sv ProjectDetail) ShortVersion() string

func (ProjectDetail) TargetLarge

func (sv ProjectDetail) TargetLarge() string

func (ProjectDetail) TargetLibName

func (sv ProjectDetail) TargetLibName() string

func (ProjectDetail) TargetSmall

func (sv ProjectDetail) TargetSmall() string

func (ProjectDetail) Version

func (sv ProjectDetail) Version() string

func (ProjectDetail) VersionMajor

func (sv ProjectDetail) VersionMajor() int

func (ProjectDetail) VersionMinor

func (sv ProjectDetail) VersionMinor() int

func (ProjectDetail) VersionPatch

func (sv ProjectDetail) VersionPatch() int

type Require

type Require struct {
	PackageName string
	LibName     string
}

func DependenciesLibs

func DependenciesLibs(config *PackageConfig, dependencies []*PackageConfig) []Require

type SourceBundle

type SourceBundle struct {
	Name                  string
	Files                 []string
	Test                  bool
	PlatformSpecificFiles map[string][]string
}

func NewSourceBundle

func NewSourceBundle(name string, test bool) *SourceBundle

func (SourceBundle) DefineList

func (s SourceBundle) DefineList() string

func (SourceBundle) EndLoop

func (s SourceBundle) EndLoop() string

func (SourceBundle) HasItem

func (s SourceBundle) HasItem() bool

func (SourceBundle) StartLoop

func (s SourceBundle) StartLoop() string

type SourcePathFilter

type SourcePathFilter struct {
	// contains filtered or unexported fields
}

func NewSourcePathFilter

func NewSourcePathFilter(config *PackageConfig, paths []string) *SourcePathFilter

func (SourcePathFilter) Match

func (pf SourcePathFilter) Match(path string) bool

Jump to

Keyboard shortcuts

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