~eliasnaur/gio

6433cb2d883ac3011a5fb483fe59911b51f692ee — Elias Naur 7 months ago b34389a
cmd/gio: change all occurences of *appID with the buildInfo field

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2 files changed, 7 insertions(+), 7 deletions(-)

M cmd/gio/androidbuild.go
M cmd/gio/iosbuild.go
M cmd/gio/androidbuild.go => cmd/gio/androidbuild.go +2 -2
@@ 200,7 200,7 @@ func archiveAndroid(tmpDir string, bi *buildInfo) (err error) {
}

func exeAndroid(tmpDir string, tools *androidTools, bi *buildInfo) (err error) {
	if *appID == "" {
	if bi.appID == "" {
		return errors.New("app id is empty; use -appid to set it")
	}
	classes := filepath.Join(tmpDir, "classes")


@@ 310,7 310,7 @@ func exeAndroid(tmpDir string, tools *androidTools, bi *buildInfo) (err error) {
			</intent-filter>
		</activity>
	</application>
</manifest>`, *appID, bi.version, bi.version, iconSnip, appName, appName)
</manifest>`, bi.appID, bi.version, bi.version, iconSnip, appName, appName)
	manifest := filepath.Join(tmpDir, "AndroidManifest.xml")
	if err := ioutil.WriteFile(manifest, []byte(manifestSrc), 0660); err != nil {
		return err

M cmd/gio/iosbuild.go => cmd/gio/iosbuild.go +5 -5
@@ 68,7 68,7 @@ func buildIOS(tmpDir, target string, bi *buildInfo) error {
		if err := exeIOS(tmpDir, target, appDir, bi); err != nil {
			return err
		}
		if err := signIOS(tmpDir, appDir, out); err != nil {
		if err := signIOS(bi, tmpDir, appDir, out); err != nil {
			return err
		}
		return zipDir(out, tmpDir, "Payload")


@@ 77,7 77,7 @@ func buildIOS(tmpDir, target string, bi *buildInfo) error {
	}
}

func signIOS(tmpDir, app, ipa string) error {
func signIOS(bi *buildInfo, tmpDir, app, ipa string) error {
	home, err := os.UserHomeDir()
	if err != nil {
		return err


@@ 114,7 114,7 @@ func signIOS(tmpDir, app, ipa string) error {
		if err != nil {
			return err
		}
		expAppID := fmt.Sprintf("%s.%s", appIDPrefix, *appID)
		expAppID := fmt.Sprintf("%s.%s", appIDPrefix, bi.appID)
		avail = append(avail, provAppID)
		if expAppID != provAppID {
			continue


@@ 146,11 146,11 @@ func signIOS(tmpDir, app, ipa string) error {
		_, err = runCmd(exec.Command("codesign", "-s", signIdentity, "--entitlements", entFile, app))
		return err
	}
	return fmt.Errorf("sign: no valid provisioning profile found for bundle id %q among %v", *appID, avail)
	return fmt.Errorf("sign: no valid provisioning profile found for bundle id %q among %v", bi.appID, avail)
}

func exeIOS(tmpDir, target, app string, bi *buildInfo) error {
	if *appID == "" {
	if bi.appID == "" {
		return errors.New("app id is empty; use -appid to set it")
	}
	if err := os.RemoveAll(app); err != nil {