当前位置: 首页>>代码示例>>Python>>正文


Python Tns.prepare_android方法代码示例

本文整理汇总了Python中core.tns.tns.Tns.prepare_android方法的典型用法代码示例。如果您正苦于以下问题:Python Tns.prepare_android方法的具体用法?Python Tns.prepare_android怎么用?Python Tns.prepare_android使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在core.tns.tns.Tns的用法示例。


在下文中一共展示了Tns.prepare_android方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_100_prepare_ios

# 需要导入模块: from core.tns.tns import Tns [as 别名]
# 或者: from core.tns.tns.Tns import prepare_android [as 别名]
    def test_100_prepare_ios(self):
        Tns.platform_add_android(attributes={"--path": self.app_name, "--frameworkPath": ANDROID_PACKAGE})

        # Initial prepare should be full.
        output = Tns.prepare_ios(attributes={"--path": self.app_name})
        TnsAsserts.prepared(self.app_name, platform=Platform.IOS, output=output, prepare=Prepare.FULL)

        # If no file is touched next time prepare should be skipped at all.
        output = Tns.prepare_ios(attributes={"--path": self.app_name}, assert_success=False)
        TnsAsserts.prepared(self.app_name, platform=Platform.IOS, output=output, prepare=Prepare.SKIP)

        # If some JS/CSS/XML is changed incremental prepare should be done.
        ReplaceHelper.replace(self.app_name, ReplaceHelper.CHANGE_JS)
        output = Tns.prepare_ios(attributes={"--path": self.app_name})
        TnsAsserts.prepared(self.app_name, platform=Platform.IOS, output=output, prepare=Prepare.INCREMENTAL)

        # Verify Xcode Schemes
        output = run("xcodebuild -project " + self.app_name + "/platforms/ios/TestApp.xcodeproj/ -list")
        assert "This project contains no schemes." not in output
        result = re.search("Targets:\n\s*TestApp", output)
        assert result is not None
        result = re.search("Schemes:\n\s*TestApp", output)
        assert result is not None

        # Initial prepare for other platform (Android) should be full.
        output = Tns.prepare_android(attributes={"--path": self.app_name})
        TnsAsserts.prepared(self.app_name, platform=Platform.ANDROID, output=output, prepare=Prepare.FULL)

        # Prepare original platform (iOS) should be skipped.
        output = Tns.prepare_ios(attributes={"--path": self.app_name}, assert_success=False)
        TnsAsserts.prepared(self.app_name, platform=Platform.IOS, output=output, prepare=Prepare.SKIP)

        # Initial prepare for other platform (Android) should be skipped.
        output = Tns.prepare_android(attributes={"--path": self.app_name}, assert_success=False)
        TnsAsserts.prepared(self.app_name, platform=Platform.ANDROID, output=output, prepare=Prepare.SKIP)
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:37,代码来源:prepare_ios_tests.py

示例2: test_391_platform_list

# 需要导入模块: from core.tns.tns import Tns [as 别名]
# 或者: from core.tns.tns.Tns import prepare_android [as 别名]
    def test_391_platform_list(self):
        """Platform list command should list installed platforms and if app is prepared for those platforms"""
        Folder.cleanup(self.app_name)
        Tns.create_app(self.app_name, update_modules=False)

        # `tns platform list` on brand new project
        output = Tns.platform_list(attributes={"--path": self.app_name})
        TnsAsserts.platform_list_status(output=output, prepared=Platform.NONE, added=Platform.NONE)

        # `tns platform list` when iOS is added
        Tns.platform_add_ios(attributes={"--path": self.app_name, "--frameworkPath": IOS_PACKAGE})
        output = Tns.platform_list(attributes={"--path": self.app_name})
        TnsAsserts.platform_list_status(output=output, prepared=Platform.NONE, added=Platform.IOS)

        # `tns platform list` when iOS is prepared
        Tns.prepare_ios(attributes={"--path": self.app_name})
        output = Tns.platform_list(attributes={"--path": self.app_name})
        TnsAsserts.platform_list_status(output=output, prepared=Platform.IOS, added=Platform.IOS)

        # `tns platform list` when android is added (iOS already prepared)
        Tns.platform_add_android(attributes={"--path": self.app_name, "--frameworkPath": ANDROID_PACKAGE})
        output = Tns.platform_list(attributes={"--path": self.app_name})
        TnsAsserts.platform_list_status(output=output, prepared=Platform.IOS, added=Platform.BOTH)

        # `tns platform list` when android is prepared (iOS already prepared)
        Tns.prepare_android(attributes={"--path": self.app_name})
        output = Tns.platform_list(attributes={"--path": self.app_name})
        TnsAsserts.platform_list_status(output=output, prepared=Platform.BOTH, added=Platform.BOTH)

        # Verify build both platforms is not allowed
        # Test for https://github.com/NativeScript/nativescript-cli/pull/3425
        output = Tns.run_tns_command(command="build", attributes={"--path": self.app_name})
        assert "The input is not valid sub-command for 'build' command" in output
        assert "<Platform> is the target mobile platform for which you want to build your project" in output
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:36,代码来源:platform_ios_tests.py

示例3: test_401_prepare_project_with_many_dependencies

# 需要导入模块: from core.tns.tns import Tns [as 别名]
# 或者: from core.tns.tns.Tns import prepare_android [as 别名]
 def test_401_prepare_project_with_many_dependencies(self):
     """
     Test for https://github.com/NativeScript/nativescript-cli/issues/2561
     """
     Folder.cleanup(self.app_name)
     Tns.create_app_ng(app_name=self.app_name, template_version="4", update_modules=False)
     if USE_YARN == "True":
         Npm.install(package="lodash", folder=self.app_name)
         Npm.install(package="moment", folder=self.app_name)
         Npm.install(package="nativescript-cardview", folder=self.app_name)
         Npm.install(package="nativescript-sqlite", folder=self.app_name)
         Npm.install(package="nativescript-statusbar", folder=self.app_name)
         Npm.install(package="nativescript-websockets", folder=self.app_name)
         Npm.install(package="number-generator", folder=self.app_name)
         Npm.install(package="eslint", folder=self.app_name)
         Npm.install(package="eslint-plugin-compat", folder=self.app_name)
     else:
         Npm.install(package="lodash", option="--save", folder=self.app_name)
         Npm.install(package="moment", option="--save", folder=self.app_name)
         Npm.install(package="nativescript-cardview", option="--save", folder=self.app_name)
         Npm.install(package="nativescript-sqlite", option="--save", folder=self.app_name)
         Npm.install(package="nativescript-statusbar", option="--save", folder=self.app_name)
         Npm.install(package="nativescript-websockets", option="--save", folder=self.app_name)
         Npm.install(package="number-generator", option="--save", folder=self.app_name)
         Npm.install(package="eslint", option="--save", folder=self.app_name)
         Npm.install(package="eslint-plugin-compat", option="--save", folder=self.app_name)
     Tns.platform_add_android(version="4", attributes={"--path": self.app_name})
     Tns.prepare_android(attributes={"--path": self.app_name}, log_trace=True)
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:30,代码来源:prepare_android_tests.py

示例4: test_301_prepare_android_platform_specific_files

# 需要导入模块: from core.tns.tns import Tns [as 别名]
# 或者: from core.tns.tns.Tns import prepare_android [as 别名]
    def test_301_prepare_android_platform_specific_files(self):
        Tns.prepare_android(attributes={"--path": self.app_name})

        # Add set of platform specific files
        File.copy(self.app_name + "/app/app.js", self.app_name + "/app/app.ios.js")
        File.copy(self.app_name + "/app/app.js", self.app_name + "/app/app.android.js")
        File.copy(self.app_name + "/app/app.js", self.app_name + "/app/appios.js")
        File.copy(self.app_name + "/app/app.js", self.app_name + "/app/appandroid.js")
        File.copy(self.app_name + "/app/app.js", self.app_name + "/app/ios.js")
        File.copy(self.app_name + "/app/app.js", self.app_name + "/app/android.js")

        File.copy(self.app_name + "/app/app.css", self.app_name + "/app/app.ios.css")
        File.copy(self.app_name + "/app/app.css", self.app_name + "/app/app.android.css")
        File.copy(self.app_name + "/app/app.js", self.app_name + "/app/appNew.js")
        File.copy(self.app_name + "/app/app.css", self.app_name + "/app/appNew.css")
        File.remove(self.app_name + "/app/app.js")
        File.remove(self.app_name + "/app/app.css")

        Tns.prepare_android(attributes={"--path": self.app_name})

        # Verify new files are in available in platforms folder
        app_path = os.path.join(self.app_name, TnsAsserts.PLATFORM_ANDROID_APP_PATH)
        assert File.exists(os.path.join(app_path, 'app.css'))
        assert File.exists(os.path.join(app_path, 'app.js'))
        assert File.exists(os.path.join(app_path, 'appandroid.js'))
        assert File.exists(os.path.join(app_path, 'appios.js'))
        assert File.exists(os.path.join(app_path, 'android.js'))
        assert File.exists(os.path.join(app_path, 'ios.js'))
        assert not File.exists(os.path.join(app_path, 'app.ios.css'))
        assert not File.exists(os.path.join(app_path, 'app.android.css'))
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:32,代码来源:prepare_android_tests.py

示例5: test_310_prepare_should_flatten_scoped_dependencies

# 需要导入模块: from core.tns.tns import Tns [as 别名]
# 或者: from core.tns.tns.Tns import prepare_android [as 别名]
    def test_310_prepare_should_flatten_scoped_dependencies(self):
        Folder.cleanup(self.app_name)
        Tns.create_app_ng(self.app_name)
        Tns.platform_add_android(attributes={"--path": self.app_name, "--frameworkPath": ANDROID_PACKAGE})
        Tns.prepare_android(attributes={"--path": self.app_name})

        # Verify scoped dependencies are flattened (verify #1783 is fixed)
        ng_path = os.path.join(self.app_name, TnsAsserts.PLATFORM_ANDROID_NPM_MODULES_PATH, '@angular', 'core')
        assert File.exists(ng_path), "Scoped dependencies are flattened, please see #1783!"
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:11,代码来源:prepare_android_tests.py

示例6: test_101_prepare_android

# 需要导入模块: from core.tns.tns import Tns [as 别名]
# 或者: from core.tns.tns.Tns import prepare_android [as 别名]
    def test_101_prepare_android(self):
        # Initial prepare should be full.
        output = Tns.prepare_android(attributes={"--path": self.app_name})
        TnsAsserts.prepared(self.app_name, platform=Platform.ANDROID, output=output, prepare=Prepare.FULL)

        # If no file is touched next time prepare should be skipped at all.
        output = Tns.prepare_android(attributes={"--path": self.app_name}, assert_success=False)
        TnsAsserts.prepared(self.app_name, platform=Platform.ANDROID, output=output, prepare=Prepare.SKIP)

        # If some JS/CSS/XML is changed incremental prepare should be done.
        ReplaceHelper.replace(self.app_name, ReplaceHelper.CHANGE_JS)
        output = Tns.prepare_android(attributes={"--path": self.app_name})
        TnsAsserts.prepared(self.app_name, platform=Platform.ANDROID, output=output, prepare=Prepare.INCREMENTAL)
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:15,代码来源:prepare_android_tests.py

示例7: test_301_prepare_android_does_not_prepare_ios

# 需要导入模块: from core.tns.tns import Tns [as 别名]
# 或者: from core.tns.tns.Tns import prepare_android [as 别名]
    def test_301_prepare_android_does_not_prepare_ios(self):
        Tns.plugin_add("nativescript-social-share", attributes={"--path": self.app_name})
        Tns.plugin_add("[email protected]", attributes={"--path": self.app_name})

        output = Tns.prepare_android(attributes={"--path": self.app_name})
        assert "nativescript-iqkeyboardmanager is not supported for android" in output
        assert "Successfully prepared plugin nativescript-social-share for android" in output
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:9,代码来源:prepare_ios_tests.py

示例8: test_390_platform_list

# 需要导入模块: from core.tns.tns import Tns [as 别名]
# 或者: from core.tns.tns.Tns import prepare_android [as 别名]
    def test_390_platform_list(self):
        """Platform list command should list installed platforms and if app is prepared for those platforms"""
        # issue with v2 of templates - workaround with remove ios platform
        Tns.platform_remove(platform=Platform.IOS, attributes={"--path": self.app_name}, assert_success=False)

        # `tns platform list` on brand new project
        output = Tns.platform_list(attributes={"--path": self.app_name})
        TnsAsserts.platform_list_status(output=output, prepared=Platform.NONE, added=Platform.NONE)

        # `tns platform list` when android is added
        Tns.platform_add_android(attributes={"--path": self.app_name, "--frameworkPath": ANDROID_PACKAGE})
        output = Tns.platform_list(attributes={"--path": self.app_name})
        TnsAsserts.platform_list_status(output=output, prepared=Platform.NONE, added=Platform.ANDROID)

        # `tns platform list` when android is prepared
        Tns.prepare_android(attributes={"--path": self.app_name})
        output = Tns.platform_list(attributes={"--path": self.app_name})
        TnsAsserts.platform_list_status(output=output, prepared=Platform.ANDROID, added=Platform.ANDROID)
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:20,代码来源:platform_android_tests.py

示例9: test_330_prepare_android_next

# 需要导入模块: from core.tns.tns import Tns [as 别名]
# 或者: from core.tns.tns.Tns import prepare_android [as 别名]
 def test_330_prepare_android_next(self):
     Tns.platform_remove(platform=Platform.ANDROID, attributes={"--path": self.app_name}, assert_success=False)
     Tns.platform_add_android(attributes={"--path": self.app_name}, version="next")
     Folder.cleanup(os.path.join(self.app_name, "node_modules"))
     Folder.cleanup(os.path.join(self.app_name, "platforms"))
     android_version = Npm.get_version("[email protected]")
     File.replace(file_path=os.path.join(self.app_name, "package.json"), str1=android_version, str2="next")
     output = Tns.prepare_android(attributes={"--path": self.app_name})
     TnsAsserts.prepared(self.app_name, platform=Platform.ANDROID, output=output, prepare=Prepare.FIRST_TIME)
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:11,代码来源:prepare_android_tests.py

示例10: test_210_platform_not_need_remove_after_bitcode_error

# 需要导入模块: from core.tns.tns import Tns [as 别名]
# 或者: from core.tns.tns.Tns import prepare_android [as 别名]
 def test_210_platform_not_need_remove_after_bitcode_error(self):
     # https://github.com/NativeScript/nativescript-cli/issues/3741
     Tns.platform_remove(platform=Platform.ANDROID, attributes={"--path": self.app_name}, assert_success=False)
     Folder.navigate_to(self.app_name + "/app")
     path = os.path.join(self.app_name + "/app")
     run("touch a")
     run("ln -s a b")
     run("rm a")
     Folder.navigate_to(folder=TEST_RUN_HOME, relative_from_current_folder=False)
     output = Tns.prepare_android(attributes={"--path": self.app_name})
     assert "Project successfully prepared" in output
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:13,代码来源:prepare_android_tests.py

示例11: test_320_prepare_scoped_plugins

# 需要导入模块: from core.tns.tns import Tns [as 别名]
# 或者: from core.tns.tns.Tns import prepare_android [as 别名]
    def test_320_prepare_scoped_plugins(self):
        """
        Test for https://github.com/NativeScript/nativescript-cli/pull/3080

        Before this change we copied all NG components at following location (js demo of nativescript-facebook):
        platforms/android/src/main/assets/app/tns_modules/nativescript-facebook/node_modules/@angular

        Now folder above should be empty (or not existing at all).
        """

        Folder.cleanup("nativescript-facebook")
        Git.clone_repo(repo_url='[email protected]:NativeScript/nativescript-facebook.git',
                       local_folder="nativescript-facebook")
        Folder.navigate_to(folder="nativescript-facebook/src")
        output = run(command="npm run build")
        Folder.navigate_to(folder=TEST_RUN_HOME, relative_from_current_folder=False)
        assert "tsc" in output
        assert "ERR" not in output
        Tns.prepare_android(attributes={"--path": "nativescript-facebook/demo"})
        output = run(command="find nativescript-facebook/demo/platforms/android/ | grep @")
        assert "@angular/core" not in output, "@angular/* should not be in platforms folder."
        assert "@angular/router" not in output, "@angular/* should not be in platforms folder."
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:24,代码来源:prepare_android_tests.py

示例12: test_300_prepare_android_remove_old_files

# 需要导入模块: from core.tns.tns import Tns [as 别名]
# 或者: from core.tns.tns.Tns import prepare_android [as 别名]
    def test_300_prepare_android_remove_old_files(self):
        Tns.prepare_android(attributes={"--path": self.app_name})

        # Add new files and delete old files
        time.sleep(1)
        File.copy(self.app_name + "/app/app.js", self.app_name + "/app/app-new.js")
        File.copy(self.app_name + "/app/app.css", self.app_name + "/app/app-new.css")
        File.copy(self.app_name + "/app/main-page.xml", self.app_name + "/app/main-page-new.xml")
        File.remove(self.app_name + "/app/app.js")
        File.remove(self.app_name + "/app/app.css")
        File.remove(self.app_name + "/app/main-page.xml")

        Tns.prepare_android(attributes={"--path": self.app_name})

        # Verify new files are in available in platforms folder
        app_path = os.path.join(self.app_name, TnsAsserts.PLATFORM_ANDROID_APP_PATH)
        assert File.exists(os.path.join(app_path, 'app-new.js'))
        assert File.exists(os.path.join(app_path, 'app-new.css'))
        assert File.exists(os.path.join(app_path, 'main-page-new.xml'))

        # Verify old files are removed from folder
        assert not File.exists(os.path.join(app_path, 'app.js'))
        assert not File.exists(os.path.join(app_path, 'app.css'))
        assert not File.exists(os.path.join(app_path, 'main-page.xml'))
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:26,代码来源:prepare_android_tests.py

示例13: test_201_build_android_with_additional_prepare

# 需要导入模块: from core.tns.tns import Tns [as 别名]
# 或者: from core.tns.tns.Tns import prepare_android [as 别名]
 def test_201_build_android_with_additional_prepare(self):
     """Verify that manually running prepare does not break next build command."""
     ReplaceHelper.replace(self.app_name, file_change=ReplaceHelper.CHANGE_JS)
     output = Tns.prepare_android(attributes={"--path": self.app_name}, assert_success=False)
     TnsAsserts.prepared(self.app_name, platform=Platform.ANDROID, output=output, prepare=Prepare.INCREMENTAL)
     Tns.build_android(attributes={"--path": self.app_name})
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:8,代码来源:build_android_tests.py

示例14: test_201_prepare_xml_error

# 需要导入模块: from core.tns.tns import Tns [as 别名]
# 或者: from core.tns.tns.Tns import prepare_android [as 别名]
 def test_201_prepare_xml_error(self):
     Tns.platform_remove(platform=Platform.ANDROID, attributes={"--path": self.app_name}, assert_success=False)
     ReplaceHelper.replace(self.app_name, ReplaceHelper.CHANGE_XML_INVALID_SYNTAX)
     output = Tns.prepare_android(attributes={"--path": self.app_name})
     assert "main-page.xml has syntax errors." in output
     assert "unclosed xml attribute" in output
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:8,代码来源:prepare_android_tests.py

示例15: test_200_prepare_android_platform_not_added

# 需要导入模块: from core.tns.tns import Tns [as 别名]
# 或者: from core.tns.tns.Tns import prepare_android [as 别名]
 def test_200_prepare_android_platform_not_added(self):
     Tns.platform_remove(platform=Platform.ANDROID, attributes={"--path": self.app_name}, assert_success=False)
     output = Tns.prepare_android(attributes={"--path": self.app_name})
     TnsAsserts.prepared(self.app_name, platform=Platform.ANDROID, output=output, prepare=Prepare.FIRST_TIME)
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:6,代码来源:prepare_android_tests.py


注:本文中的core.tns.tns.Tns.prepare_android方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。