Exemplo n.º 1
0
 def test_build_and_use(self, core_install_mock, get_user_mock):
     """
     Test baking a plugin and bootstrapping it with current tk-core.
     """
     default_user = self._create_session_user("default_user")
     get_user_mock.return_value = default_user
     # Bake the plugin
     import build_plugin
     plugin_path = os.path.join(self.fixtures_root, "bootstrap_tests", "test_plugin")
     bake_folder = os.path.join(self.tank_temp, "test_baked")
     build_plugin.build_plugin(
         self.mockgun,
         plugin_path,
         bake_folder,
         do_bake=True,
         use_system_core=True,
     )
     # And try to bootstrap it
     # The config name and version is controlled by the
     # fixtures/bootstrap_tests/test_plugin/info.yml file.
     bootstrap_script = os.path.join(bake_folder, "tk-config-boottest-v1.2.3", "bootstrap.py")
     # Define some globals needed by the bootstrap script
     global_namespace = {
         "__file__": bootstrap_script,
         "__name__": "__main__",
     }
     with open(bootstrap_script, "rb") as pf:
         exec(compile(pf.read(), bootstrap_script, "exec"), global_namespace)
     self.assertNotEqual(sgtk.platform.current_engine(), None)
     sgtk.platform.current_engine().destroy()
Exemplo n.º 2
0
def build_project(project):
    global updated_plugin
    # Extract our name and type
    project_name = project['name']
    project_type = project['type']
    if not args.package:
        package = 'all'
    else:
        package = args.package
    print("-> Building project '{name}'".format(name=project_name))
    # Build the project
    if project['type'] == 'plugin':
        result = build_plugin.build_plugin(project)
        if result:
            updated_plugin = True
    elif project['type'] == 'client':
        result = build_client.build_client(project, package,
                                           args.web_target[0])
    elif project['type'] == 'server':
        result = build_server.build_server(project, package)
    elif project['type'] == 'ffmpeg':
        result = build_ffmpeg.build_ffmpeg(project, package)
    elif project['type'] == 'meta':
        # Meta projects have no build component
        pass
    else:
        print("ERROR: Invalid project type.")
Exemplo n.º 3
0
parser.add_argument('--plugin',
                    required=True,
                    help='The plugin file to release')
parser.add_argument('--engine', required=True, help='UE4 install path')
args = parser.parse_args()

github_username = os.environ['github_user']
github_password = os.environ['github_password']

plugin_folder = os.path.dirname(os.path.abspath(args.plugin))
tag_version = gitutil.get_git_tag(plugin_folder)
platform = ue4util.get_platform_name()

folder = os.path.join(build_folder, '%s' % tag_version)
zip_file = os.path.join('unrealcv-%s-%s.zip' % (tag_version, platform))

if not os.path.isfile(zip_file):
    build_plugin(plugin=args.plugin,
                 engine=args.engine,
                 output=folder,
                 release=True)
    zip_folder(folder, zip_file)

release_to_github(user=github_username,
                  password=github_password,
                  repo='qiuwch/unrealcv',
                  file=zip_file,
                  tag=tag_version,
                  ignore_check=True)
# We already did check in previous step