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


Python Tns.platform_add_android方法代码示例

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


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

示例1: test_311_build_android_with_custom_compile_sdk_old

# 需要导入模块: from core.tns.tns import Tns [as 别名]
# 或者: from core.tns.tns.Tns import platform_add_android [as 别名]
 def test_311_build_android_with_custom_compile_sdk_old(self):
     #https://github.com/NativeScript/nativescript-cli/issues/4052
     # This is required when build with different SDK
     Folder.cleanup(self.app_name)
     Tns.create_app(self.app_name)
     Tns.platform_add_android(attributes={"--path": self.app_name, "--frameworkPath": ANDROID_PACKAGE})
     Tns.build_android(attributes={"--compileSdk": "27", "--path": self.app_name})
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:9,代码来源:build_android_tests.py

示例2: test_301_build_project_with_space_release

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

        # Ensure ANDROID_KEYSTORE_PATH contain spaces (verification for CLI issue 2650)
        Folder.create("with space")
        base_path, file_name = os.path.split(ANDROID_KEYSTORE_PATH)
        cert_with_space_path = os.path.join("with space", file_name)
        File.copy(src=ANDROID_KEYSTORE_PATH, dest=cert_with_space_path)

        # Verify project builds
        Tns.build_android(attributes={"--path": "\"" + self.app_name_space + "\"",
                                      "--keyStorePath": "\"" + cert_with_space_path + "\"",
                                      "--keyStorePassword": ANDROID_KEYSTORE_PASS,
                                      "--keyStoreAlias": ANDROID_KEYSTORE_ALIAS,
                                      "--keyStoreAliasPassword": ANDROID_KEYSTORE_ALIAS_PASS,
                                      "--release": ""
                                      })

        output = File.read(self.app_name_space + os.sep + "package.json")
        assert app_identifier in output.lower()

        output = File.read(
            self.app_name_space + "/" + TnsAsserts.PLATFORM_ANDROID_SRC_MAIN_PATH + "AndroidManifest.xml")
        assert app_identifier in output.lower()
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:28,代码来源:build_android_tests.py

示例3: test_100_prepare_ios

# 需要导入模块: from core.tns.tns import Tns [as 别名]
# 或者: from core.tns.tns.Tns import platform_add_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

示例4: test_401_prepare_project_with_many_dependencies

# 需要导入模块: from core.tns.tns import Tns [as 别名]
# 或者: from core.tns.tns.Tns import platform_add_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

示例5: test_391_platform_list

# 需要导入模块: from core.tns.tns import Tns [as 别名]
# 或者: from core.tns.tns.Tns import platform_add_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

示例6: setUpClass

# 需要导入模块: from core.tns.tns import Tns [as 别名]
# 或者: from core.tns.tns.Tns import platform_add_android [as 别名]
    def setUpClass(cls):
        BaseClass.setUpClass(cls.__name__)
        Emulator.stop()
        Emulator.ensure_available()

        Tns.create_app(cls.app_name, update_modules=True)
        Tns.install_npm(package=WEBPACK_PACKAGE, option='--save-dev', folder=cls.app_name)
        Tns.platform_add_android(attributes={"--path": cls.app_name, "--frameworkPath": ANDROID_PACKAGE})
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:10,代码来源:hello_world_js_hmr_android.py

示例7: setUpClass

# 需要导入模块: from core.tns.tns import Tns [as 别名]
# 或者: from core.tns.tns.Tns import platform_add_android [as 别名]
 def setUpClass(cls):
     BaseClass.setUpClass(cls.__name__)
     Emulator.stop()
     Device.ensure_available(platform=Platform.ANDROID)
     Device.uninstall_app(app_prefix="org.nativescript.", platform=Platform.ANDROID)
     Tns.create_app(cls.app_name,
                    attributes={'--template': os.path.join('data', 'apps', 'livesync-hello-world.tgz')},
                    update_modules=True)
     Tns.platform_add_android(attributes={'--path': cls.app_name, '--frameworkPath': ANDROID_PACKAGE})
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:11,代码来源:run_android_device_tests.py

示例8: test_313_build_android_with_invalid_compile_sdk

# 需要导入模块: from core.tns.tns import Tns [as 别名]
# 或者: from core.tns.tns.Tns import platform_add_android [as 别名]
    def test_313_build_android_with_invalid_compile_sdk(self):
        # This is required when build with different SDK
        Folder.cleanup(self.app_name)
        Tns.create_app(self.app_name)
        Tns.platform_add_android(attributes={"--path": self.app_name, "--frameworkPath": ANDROID_PACKAGE})

        output = Tns.build_android(attributes={"--compileSdk": "99", "--path": self.app_name},
                                   assert_success=False)
        assert "You have specified '99' for compile sdk, but it is not installed on your system." in output
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:11,代码来源:build_android_tests.py

示例9: test_310_prepare_should_flatten_scoped_dependencies

# 需要导入模块: from core.tns.tns import Tns [as 别名]
# 或者: from core.tns.tns.Tns import platform_add_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

示例10: test_330_prepare_android_next

# 需要导入模块: from core.tns.tns import Tns [as 别名]
# 或者: from core.tns.tns.Tns import platform_add_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

示例11: test_200_platform_update_android

# 需要导入模块: from core.tns.tns import Tns [as 别名]
# 或者: from core.tns.tns.Tns import platform_add_android [as 别名]
    def test_200_platform_update_android(self):
        """Update platform"""

        # Create project with [email protected]
        Tns.platform_add_android(version="4.0.0", attributes={"--path": self.app_name})
        TnsAsserts.package_json_contains(self.app_name, ["\"version\": \"4.0.0\""])

        # Update platform to 5
        Tns.platform_update(platform=Platform.ANDROID, version="5.0.0", attributes={"--path": self.app_name})
        TnsAsserts.package_json_contains(self.app_name, ["\"version\": \"5.0.0\""])
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:12,代码来源:platform_android_tests.py

示例12: setUpClass

# 需要导入模块: from core.tns.tns import Tns [as 别名]
# 或者: from core.tns.tns.Tns import platform_add_android [as 别名]
    def setUpClass(cls):
        BaseClass.setUpClass(cls.__name__)
        Emulator.stop()
        Device.uninstall_app(app_prefix="org.nativescript.", platform=Platform.ANDROID)
        Emulator.ensure_available()
        Folder.cleanup(cls.app_name)

        # Create default NG app (to get right dependencies from package.json)
        Tns.create_app_ng(cls.app_name)
        Tns.platform_add_android(attributes={'--path': cls.app_name, '--frameworkPath': ANDROID_PACKAGE}) 
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:12,代码来源:run_android_ng_tests.py

示例13: test_220_platform_clean_android

# 需要导入模块: from core.tns.tns import Tns [as 别名]
# 或者: from core.tns.tns.Tns import platform_add_android [as 别名]
    def test_220_platform_clean_android(self):
        """Prepare after `platform clean` should add the same version that was before clean"""

        # Create project with [email protected]
        Tns.platform_add_android(version="5.0.0", attributes={"--path": self.app_name})
        TnsAsserts.package_json_contains(self.app_name, ["\"version\": \"5.0.0\""])

        # Clean platform and verify platform is 5.0.0
        Tns.platform_clean(platform=Platform.ANDROID, attributes={"--path": self.app_name})
        TnsAsserts.package_json_contains(self.app_name, ["\"version\": \"5.0.0\""])
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:12,代码来源:platform_android_tests.py

示例14: test_321_build_with_copy_to_option

# 需要导入模块: from core.tns.tns import Tns [as 别名]
# 或者: from core.tns.tns.Tns import platform_add_android [as 别名]
    def test_321_build_with_copy_to_option(self):
        # TODO: Remove those lines after https://github.com/NativeScript/nativescript-cli/issues/2547 is fixed.
        # This is required when build with different SDK
        Folder.cleanup(self.app_name)
        Tns.create_app(self.app_name)
        Tns.platform_add_android(attributes={"--path": self.app_name, "--frameworkPath": ANDROID_PACKAGE})

        File.remove(self.debug_apk)
        Tns.build_android(attributes={"--path": self.app_name, "--copy-to": "./"})
        assert File.exists(self.debug_apk)
        File.remove(self.debug_apk)
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:13,代码来源:build_android_tests.py

示例15: setUp

# 需要导入模块: from core.tns.tns import Tns [as 别名]
# 或者: from core.tns.tns.Tns import platform_add_android [as 别名]
 def setUp(self):
     BaseClass.setUp(self)
     Folder.cleanup(self.source_app)
     if CURRENT_OS != OSType.WINDOWS:
         Folder.copy(self.temp_app, self.source_app)
     else:
         Tns.create_app(self.app_name,
                        attributes={'--template': os.path.join('data', 'apps', 'livesync-hello-world.tgz')},
                        update_modules=True)
         Tns.platform_add_android(attributes={'--path': self.app_name, '--frameworkPath': ANDROID_PACKAGE})
         Emulator.ensure_available()
开发者ID:NativeScript,项目名称:nativescript-cli-tests,代码行数:13,代码来源:run_android_tests.py


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