Skip to content

Instantly share code, notes, and snippets.

@MathiasSeguy-Android2EE
Created August 17, 2019 12:28
Show Gist options
  • Save MathiasSeguy-Android2EE/751b262513c105ecfdabec123f7474f2 to your computer and use it in GitHub Desktop.
Save MathiasSeguy-Android2EE/751b262513c105ecfdabec123f7474f2 to your computer and use it in GitHub Desktop.
Does the Android project has an old Eclipse's files structure
global SPLIT_CHARACTER
if platform.system() == "Windows":
SPLIT_CHARACTER = '\\'
else:
SPLIT_CHARACTER = '/'
#Detect if your project is in an Eclipse structure
def isEclipseLegacy(directory):
hasRes=path.isdir(directory+SPLIT_CHARACTER+'res')
hasSrc=path.isdir(directory+SPLIT_CHARACTER+'src')
hasManifest=path.isfile(directory+SPLIT_CHARACTER+'AndroidManifest.xml')
hasBuildGradle=path.isfile(directory+SPLIT_CHARACTER+'build.gradle')
# if hasBuildGradle and hasSrc and hasRes and hasManifest:
# print(directory+'\n\t isEclipseLegacy')
return hasBuildGradle and hasSrc and hasRes and hasManifest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment