Skip to content

Commit

Permalink
prevent releasing an app that have org.test or org.kivy as domain. Cl…
Browse files Browse the repository at this point in the history
…oses #500
  • Loading branch information
tito committed May 14, 2017
1 parent e2b46c0 commit b656922
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion buildozer/target.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,38 @@ def cmd_debug(self, *args):
self.buildozer.build()

def cmd_release(self, *args):
error = self.buildozer.error
self.buildozer.prepare_for_build()
if self.buildozer.config.get("app", "package.domain") == "org.test":
error("")
error("ERROR: Trying to release a package that starts with org.test")
error("")
error("The package.domain org.test is, as the name intented, a test.")
error("Once you published an application with org.test,")
error("you cannot change it, it will be part of the identifier")
error("for Google Play / App Store / etc.")
error("")
error("So change package.domain to anything else.")
error("")
error("If you messed up before, set the environment variable to force the build:")
error("export BUILDOZER_ALLOW_ORG_TEST_DOMAIN=1")
error("")
if "BUILDOZER_ALLOW_ORG_TEST_DOMAIN" not in os.environ:
exit(1)

if self.buildozer.config.get("app", "package.domain") == "org.kivy":
error("")
error("ERROR: Trying to release a package that starts with org.kivy")
error("")
error("The package.domain org.kivy is reserved for the Kivy official")
error("applications. Please use your own domain.")
error("")
error("If you are a Kivy developer, add an export in your shell")
error("export BUILDOZER_ALLOW_KIVY_ORG_DOMAIN=1")
error("")
if "BUILDOZER_ALLOW_KIVY_ORG_DOMAIN" not in os.environ:
exit(1)

self.build_mode = 'release'
self.buildozer.build()

Expand All @@ -115,4 +146,3 @@ def cmd_run(self, *args):

def cmd_serve(self, *args):
self.buildozer.cmd_serve()

0 comments on commit b656922

Please sign in to comment.