Example #1
0
def getApkFileName():
	folderPath = FileUtils.getAbsolutePath(g_projectPath + s_binFolder)
	if not os.path.exists(folderPath):
		ColorPrint.errorPrint("没有找到目录" + folderPath)
		return None
	for _file in os.listdir(folderPath):
		if -1 != _file.find("release.apk"):
			return _file
	return None
Example #2
0
def loadConfigData(configPathStr):
	configPath = FileUtils.getAbsolutePath(configPathStr)
	if not os.path.exists(configPath):
		ColorPrint.errorPrint("配置文件不存在")
		return False

	file_object = open(configPath)
	try:
		fileText = file_object.read()
	finally:
		file_object.close()
	jsonDecode = json.loads(fileText)
	return jsonDecode
Example #3
0
def loadConfigData(configPathStr):
    configPath = FileUtils.getAbsolutePath(configPathStr)
    if not os.path.exists(configPath):
        ColorPrint.errorPrint("配置文件不存在")
        return False

    file_object = open(configPath)
    try:
        fileText = file_object.read()
    finally:
        file_object.close()
    jsonDecode = json.loads(fileText)
    return jsonDecode
Example #4
0
def getTargetFolderPath(versionName):
	return FileUtils.getAbsolutePath(s_publishFolder + versionName)
Example #5
0
def fileAction(apkFileName, versionName):
	apkFilePath = FileUtils.getAbsolutePath(g_projectPath + s_binFolder + apkFileName)
	targetFolder = getTargetFolderPath(versionName)
	targetFile = os.path.join(targetFolder, apkFileName)
	FileUtils.copyFile(apkFilePath, targetFolder + "/" +apkFileName)
	renameFile(targetFile, versionName)
Example #6
0
def createTargetFolder(versionName):
	path = FileUtils.getAbsolutePath(s_publishFolder + versionName)
	FileUtils.createFolder(path)
Example #7
0
def main():
	configData = loadConfigData(s_versionFilePath)
	for jsonKey in configData:
		AntVersion.changeAntFileVersion(FileUtils.getAbsolutePath(s_antPath), jsonKey, configData[jsonKey])
Example #8
0
def fixPngWarning():
	path = FileUtils.getAbsolutePath(s_rePath)
	os.chdir(path)
	os.system("find . -type f -name \"*.png\" -exec convert {} -strip {} \;")