func NewTargetTester(target *target.Target,
	testPkg *pkg.LocalPackage) (*TargetBuilder, error) {

	if err := target.Validate(testPkg == nil); err != nil {
		return nil, err
	}

	bspPkg, err := pkg.NewBspPackage(target.Bsp())
	if err != nil {
		return nil, err
	}

	compilerPkg, err := project.GetProject().ResolvePackage(
		bspPkg.Repo(), bspPkg.CompilerName)
	if err != nil {
		return nil, err
	}

	t := &TargetBuilder{
		target:           target,
		bspPkg:           bspPkg,
		compilerPkg:      compilerPkg,
		appPkg:           target.App(),
		loaderPkg:        target.Loader(),
		testPkg:          testPkg,
		injectedSettings: map[string]string{},
	}

	return t, nil
}
Example #2
0
func appFromPaths(t *target.Target) []string {
	return []string{
		/* <app>.elf */
		builder.AppElfPath(t.Name(), builder.BUILD_NAME_APP, t.App().Name()),

		/* <app>.img */
		builder.AppImgPath(t.Name(), builder.BUILD_NAME_APP, t.App().Name()),

		/* manifest.json */
		builder.ManifestPath(t.Name(), builder.BUILD_NAME_APP, t.App().Name()),
	}
}
Example #3
0
func bootLoaderFromPaths(t *target.Target) []string {
	return []string{
		/* boot.elf */
		builder.AppElfPath(t.Name(), builder.BUILD_NAME_APP, t.App().Name()),

		/* boot.elf.bin */
		builder.AppBinPath(t.Name(), builder.BUILD_NAME_APP, t.App().Name()),

		/* manifest.json */
		builder.ManifestPath(t.Name(), builder.BUILD_NAME_APP, t.App().Name()),
	}
}