Esempio n. 1
0
    def Run(self,type): 
        print ("IPABuild type="+type)

        RootDir = mainResource.GetRootProjectIos()
        target = "Unity-iPhone"  
        ipa_file = RootDir + "/app/" + target

        isUploadIPA = False
        isExportIPA = False

        # 清空频道文件
        channel_dir = mainResource.GetRootDirXcode() + "/Data/Raw/channel"
        flag = os.path.exists(channel_dir)
        if flag:
            shutil.rmtree(channel_dir)

        if type == "upload_ipa":
            isUploadIPA = True
            # ipa_file = RootDir + "/app_export_ipa/" + target
            target = "game"
            self.UploadOneIPA(ipa_file + "/" + target + ".ipa")

        if type == "export_ipa":
            isExportIPA = True
            if count > 2:
                channel = sys.argv[2] 
                ipa_file = RootDir + "/app_" + channel + "/" + target

            # 生成频道文件
            os.makedirs(channel_dir)
            fp = open(channel_dir + "/" + channel, "w")
            if fp:
                fp.close()

            
            self.ExportIPA(ipa_file)

        if type == "ipa_build":
            # CopyXcodeProject(False)
            self.BuildIPA(ipa_file)
            self.ExportIPA(ipa_file)
            
                
        if type == "upload_allipa":
            self.UploadAllIPA(mainResource.GetProjectOutPut()+"/IPA")
        
        if type == "CopyXcodeProject":
            self.CopyXcodeProject(True)

        if type == "zip_project":
            self.ZipProject()

        print ("ipa_build sucess")
Esempio n. 2
0
    def DoCopyGameData(self):
        gameName = mainResource.getGameName()
        gameType = mainResource.getGameType()
        print(gameName)
        print(gameType)

        resDataName = mainResource.getGameName()#sys.argv[1]
        gameResName = self.getGameResName()

        gameResCommonRoot = mainResource.GetDirProductCommon()+"/GameResCommon"+"/"+gameResName
        gameResRoot = mainResource.GetResourceDataRoot()+"/"+gameType+"/"+gameName+"/GameRes"
        flag = os.path.exists(gameResRoot)
        if not flag:
            #目录不存在的话到gamerescommon里copy
            gameResRoot = gameResCommonRoot

        gameDataCommonRoot = mainResource.GetDirProductCommon()+"/GameDataCommon"
        gameDataRoot = mainResource.GetResourceDataRoot()+"/"+gameType+"/"+gameName+"/GameData"

        # streamingAssetsUnity = mainResource.GetRootProjectUnity()+"/Assets/StreamingAssets"
        rootAndroidStudio =mainResource.GetRootDirAndroidStudio()
        rootiOSXcode =mainResource.GetRootDirXcode()
 
    # copy GameData 游戏配置等数据 
        dirname = "GameData"

        # unity editor 
        # dir1 = gameDataRoot
        # dir2 = streamingAssetsUnity+"/"+dirname
        # flag = os.path.exists(dir2)
        # if flag:
        #     shutil.rmtree(dir2)
        # shutil.copytree(dir1,dir2)

        # ios
        # dir2 = rootiOSXcode+"/Data/Raw/"+dirname
        # flag = os.path.exists(dir2)
        # if flag:
        #     shutil.rmtree(dir2)
        # shutil.copytree(dir1,dir2)

    # android asset
        # dir2 = rootAndroidStudio+"/src/main/assets/"+dirname
        # flag = os.path.exists(dir2)
        # if flag:
        #     shutil.rmtree(dir2)
        # shutil.copytree(dir1,dir2)


        dirname = "GameData/common"
    def Run(self):
 
        gameName = mainResource.getGameName()
        gameType = mainResource.getGameType()
        print(gameName)
        print(gameType)

        resDataName = mainResource.getGameName()#sys.argv[1]
        gameResName = self.getGameResName()

        gameResCommonRoot = mainResource.GetDirProductCommon()+"/GameResCommon"+"/"+gameResName
        gameResRoot = mainResource.GetResourceDataRoot()+"/"+gameType+"/"+gameName+"/GameRes"
        flag = os.path.exists(gameResRoot)
        if not flag:
            #目录不存在的话到gamerescommon里copy
            gameResRoot = gameResCommonRoot;

        gameDataRoot = mainResource.GetResourceDataRoot()+"/"+gameType+"/"+gameName+"/GameData"

        streamingAssetsUnity = mainResource.GetRootProjectUnity()+"/Assets/StreamingAssets"
        rootAndroidStudio = mainResource.GetRootDirAndroidStudio()
        rootiOSXcode =mainResource.GetRootDirXcode()

        
    # copy GameData 游戏配置等数据 
        dirname = "GameData/screenshot"
        # ios
        dir2 = rootiOSXcode+"/Data/Raw/"+dirname
        flag = os.path.exists(dir2)
        if flag:
            shutil.rmtree(dir2) 

        dirname = "GameData/screenshot"
    # android asset
        dir2 = rootAndroidStudio+"/src/main/assets/"+dirname
        flag = os.path.exists(dir2)
        if flag:
            shutil.rmtree(dir2) 


        print("clean_screenshot sucess")
Esempio n. 4
0
    def BuildIPA(self,ipafile):
        self.CopyExportOptionsPlist()
        self.ChmodSh()
        # curDir = "/Users/moon/Library/MobileDevice/Provisioning Profiles"
        curDir = "/Users/moon/Library/MobileDevice/Provisioning Profiles"
        self.DeleteProvisioningProfiles(curDir)  

        RootDir = mainResource.GetRootProjectIos()
        archive_file = RootDir + "/app.xcarchive"
        target = "Unity-iPhone"
        xcode_project = mainResource.GetRootDirXcode()+ "/Unity-iPhone.xcodeproj" 

        flag = os.path.exists(archive_file)
        if flag:
            shutil.rmtree(archive_file)

        flag = os.path.exists(ipafile)
        if flag:
            shutil.rmtree(ipafile)



        RootDir = mainResource.GetRootProjectIos() 
        AppDir = RootDir + "/app"
        flag = os.path.exists(AppDir)
        if flag:
            shutil.rmtree(AppDir)
        
        AppDir = RootDir + "/app_export_ipa"
        flag = os.path.exists(AppDir)
        if flag:
            shutil.rmtree(AppDir)


        strCmd = "xcodebuild -allowProvisioningUpdates -project " + xcode_project + " -scheme " + \
            target + " -configuration Release clean archive" + " -archivePath " + archive_file
        os.system(strCmd)
Esempio n. 5
0
    def DoCopyAll(self):
        gameName = mainResource.getGameName()
        gameType = mainResource.getGameType()
        print(gameName)
        print(gameType)

        resDataName = mainResource.getGameName()#sys.argv[1]
        gameResName = self.getGameResName()

        gameResCommonRoot = mainResource.GetDirProductCommon()+"/GameResCommon"+"/"+gameResName
        gameResRoot = mainResource.GetResourceDataRoot()+"/"+gameType+"/"+gameName+"/GameRes"
        flag = os.path.exists(gameResRoot)
        if not flag:
            #目录不存在的话到gamerescommon里copy
            gameResRoot = gameResCommonRoot

        gameDataCommonRoot = mainResource.GetDirProductCommon()+"/GameDataCommon"
        gameDataRoot = mainResource.GetResourceDataRoot()+"/"+gameType+"/"+gameName+"/GameData"

        rootAndroidStudio =mainResource.GetRootDirAndroidStudio()
        rootiOSXcode =mainResource.GetRootDirXcode()

        # copy GameRes 游戏图片等资源
        dirname = "GameRes"

        # unity editor 
        dir1 = gameResRoot
        dir2 = mainResource.GetRootUnityAssetsResource()+"/"+dirname
        flag = os.path.exists(dir2)
        print("GameRes dir1="+dir1+" dir2="+dir2)
        if flag:
            shutil.rmtree(dir2)
        shutil.copytree(dir1,dir2)

        # ios
        dir2 = rootiOSXcode+"/Data/Raw/"+dirname
        flag = os.path.exists(dir2)
        if flag:
            shutil.rmtree(dir2)
        shutil.copytree(dir1,dir2)

    # android asset
        dir2 = rootAndroidStudio+"/src/main/assets/"+dirname
        flag = os.path.exists(dir2)
        if flag:
            shutil.rmtree(dir2)
        shutil.copytree(dir1,dir2)


    # copy GameData 游戏配置等数据 
        dirname = "GameData"

        # unity editor 
        # dir1 = gameDataRoot
        # dir2 = streamingAssetsUnity+"/"+dirname
        # flag = os.path.exists(dir2)
        # if flag:
        #     shutil.rmtree(dir2)
        # shutil.copytree(dir1,dir2)

        # ios
        # dir2 = rootiOSXcode+"/Data/Raw/"+dirname
        # flag = os.path.exists(dir2)
        # if flag:
        #     shutil.rmtree(dir2)
        # shutil.copytree(dir1,dir2)

    # android asset
        dir2 = rootAndroidStudio+"/src/main/assets/"+dirname
        flag = os.path.exists(dir2)
        if flag:
            shutil.rmtree(dir2)
        print("gamedata dir2=",dir2)
        shutil.copytree(dir1,dir2)


        dirname = "GameData/common"

        # unity editor 
        # dir1 = gameDataCommonRoot
        # dir2 = streamingAssetsUnity+"/"+dirname
        # flag = os.path.exists(dir2)
        # if flag:
        #     shutil.rmtree(dir2)
        # shutil.copytree(dir1,dir2)

        # ios
        # dir2 = rootiOSXcode+"/Data/Raw/"+dirname
        # flag = os.path.exists(dir2)
        # if flag:
        #     shutil.rmtree(dir2)
        # shutil.copytree(dir1,dir2)

    # android asset
        dir2 = rootAndroidStudio+"/src/main/assets/"+dirname
        flag = os.path.exists(dir2)
        if flag:
            shutil.rmtree(dir2)
        shutil.copytree(dir1,dir2)

        self.CopyConfigDataToAndroid()