Esempio n. 1
0
func (a *Ant) Uninstall(args ...string) {
	//fmt.Println("uninstalling ant")
	if len(args) < 3 {
		fmt.Println("wrong args input")
		return
	}
	a.ComponentId = args[0]
	a.Version = args[1]
	a.InstallLocation = filepath.Join(args[2], "apache-ant-"+args[1])

	os.RemoveAll(a.InstallLocation)
	myutils.Delete_Environment("ANT_HOME", a.InstallLocation)
	myutils.Delete_Environment("PATH", filepath.Join(a.InstallLocation, "bin"))
}
Esempio n. 2
0
func (g *Gradle) Uninstall(args ...string) {

	if len(args) < 3 {
		fmt.Println("wrong args input")
		return
	}
	g.ComponentId = args[0]
	g.Version = args[1]
	g.InstallLocation = filepath.Join(args[2], "gradle-"+args[1])

	os.RemoveAll(g.InstallLocation)
	myutils.Delete_Environment("GRADLE_HOME", g.InstallLocation)
	myutils.Delete_Environment("PATH", filepath.Join(g.InstallLocation, "bin"))
	fmt.Println(g.InstallLocation)
}
Esempio n. 3
0
func (j *JavaSDK) Uninstall(args ...string) {
	//fmt.Println("uninstalling java")
	if len(args) < 3 {
		fmt.Println("wrong args input")
		return
	}
	j.ComponentId = args[0]
	j.Version = args[1]
	j.InstallLocation = filepath.Join(args[2], "jdk"+args[1])

	exec.Command("cmd", "/c", "del", "/F", "/S", "/Q", "/A:R", j.InstallLocation).Run()
	os.RemoveAll(j.InstallLocation)

	myutils.Delete_Environment("JAVA_HOME", j.InstallLocation)
	myutils.Delete_Environment("PATH", filepath.Join(j.InstallLocation, "bin"))
	fmt.Println(j.InstallLocation)
}
Esempio n. 4
0
func (s *SDK) Uninstall(args ...string) {
	//fmt.Println("uninstalling sdk")
	s.ComponentId = args[0]
	s.Version = args[1]
	s.InstallLocation = filepath.Join(args[2], "android-sdk-"+myutils.Global_OS, "tools")

	installLocation := filepath.Join(args[2], "android-sdk-"+myutils.Global_OS)
	os.RemoveAll(s.InstallLocation)
	os.Remove(filepath.Join(installLocation, "AVD Manager.exe"))
	os.Remove(filepath.Join(installLocation, "SDK Manager.exe"))
	os.Remove(filepath.Join(installLocation, "SDK Readme.txt"))
	os.Remove(filepath.Join(installLocation, "add-ons"))
	os.Remove(filepath.Join(installLocation, "platforms"))
	os.Remove(filepath.Join(installLocation))
	myutils.Delete_Environment("ANDROID_HOME", installLocation)
	myutils.Delete_Environment("PATH", filepath.Join(installLocation, "tools"))
	fmt.Println(installLocation)
}
Esempio n. 5
0
func (b *BuildTools) Uninstall(args ...string) {
	//fmt.Println("uninstalling sdk Build Tools")
	if len(args) < 3 {
		fmt.Println("wrong args input")
		return
	}
	b.ComponentId = args[0]
	b.Version = args[1]
	b.InstallLocation = filepath.Join(args[2], "")

	os.RemoveAll(b.InstallLocation)
	myutils.Delete_Environment("PATH", b.InstallLocation)
	fmt.Println(b.InstallLocation)
}
Esempio n. 6
0
func (s *Supportlib) Uninstall(args ...string) {

	if len(args) < 3 {
		fmt.Println("wrong args input")
		return
	}
	s.ComponentId = args[0]
	s.Version = args[1]
	s.InstallLocation = args[2]

	os.RemoveAll(s.InstallLocation)

	myutils.Delete_Environment("PATH", filepath.Join(s.InstallLocation, "support-tools"))
	fmt.Println(filepath.Join(s.InstallLocation, "support-tools"))
}
func (p *PlatformTools) Uninstall(args ...string) {

	if len(args) < 3 {
		fmt.Println("wrong args input")
		return
	}
	p.ComponentId = args[0]
	p.Version = args[1]
	p.InstallLocation = args[2]

	if myutils.Global_OS == "windows" {
		exec.Command("taskkill", "/f", "/IM", "adb.exe")

	}
	os.RemoveAll(filepath.Join(p.InstallLocation, "platform-tools"))
	//myutils.Delete_Environment("ANDROID_HOME", s.InstallLocation)
	myutils.Delete_Environment("PATH", filepath.Join(p.InstallLocation, "platform-tools"))
	fmt.Println(filepath.Join(p.InstallLocation, "platform-tools"))
}
Esempio n. 8
0
func (n *NDK) Uninstall(args ...string) {

	if len(args) < 3 {
		fmt.Println("wrong args input")
		return
	}
	n.ComponentId = args[0]
	n.Version = args[1]
	n.InstallLocation = args[2]
	location := filepath.Join(n.InstallLocation, "android-ndk-r"+n.Version)

	myutils.Delete_Environment("ANDROID_NDK_ROOT", location)
	myutils.Delete_Environment("NDK_ROOT", location)
	myutils.Delete_Environment("NDKROOT", location)
	myutils.Delete_Environment("PATH", location)
	myutils.Delete_Environment("NVPACK_NDK_VERSION", "")
	myutils.Delete_Environment("NDK_STANDALONE_46_ANDROID9_32", location)
	myutils.Delete_Environment("NDK_STANDALONE_46_ANDROID9_64", location)
	os.RemoveAll(location)
	fmt.Println(location)

}