提交 cee106b7 编写于 作者: A Adam Barth 提交者: GitHub

Remove unused build scripts (#2883)

上级 9c0a05f9
.idea/
.vagrant/
.sconsign.dblite
.svn/
.DS_Store
*.swp
*.lock
profile
DerivedData/
build/
*.pbxuser
*.mode1v3
*.mode2v3
*.perspectivev3
!default.pbxuser
!default.mode1v3
!default.mode2v3
!default.perspectivev3
xcuserdata
*.moved-aside
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
9E90D8621CEBBF2700FBBF40 /* libFlutterService.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9E90D8611CEBBF2700FBBF40 /* libFlutterService.a */; };
9E90D8651CEBCD8400FBBF40 /* ServiceMain.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9E90D8641CEBCD8400FBBF40 /* ServiceMain.cc */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
9E90D8521CEBBCEC00FBBF40 /* FlutterService.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = FlutterService.framework; sourceTree = BUILT_PRODUCTS_DIR; };
9E90D85E1CEBBEA700FBBF40 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
9E90D8611CEBBF2700FBBF40 /* libFlutterService.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libFlutterService.a; sourceTree = "<group>"; };
9E90D8641CEBCD8400FBBF40 /* ServiceMain.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ServiceMain.cc; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
9E90D84E1CEBBCEC00FBBF40 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
9E90D8621CEBBF2700FBBF40 /* libFlutterService.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
9E90D8481CEBBCEC00FBBF40 = {
isa = PBXGroup;
children = (
9E90D8631CEBCD7200FBBF40 /* Source */,
9E90D8601CEBBF2700FBBF40 /* Library */,
9E90D85D1CEBBE9B00FBBF40 /* Supporting Files */,
9E90D8531CEBBCEC00FBBF40 /* Products */,
);
sourceTree = "<group>";
};
9E90D8531CEBBCEC00FBBF40 /* Products */ = {
isa = PBXGroup;
children = (
9E90D8521CEBBCEC00FBBF40 /* FlutterService.framework */,
);
name = Products;
sourceTree = "<group>";
};
9E90D85D1CEBBE9B00FBBF40 /* Supporting Files */ = {
isa = PBXGroup;
children = (
9E90D85E1CEBBEA700FBBF40 /* Info.plist */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
9E90D8601CEBBF2700FBBF40 /* Library */ = {
isa = PBXGroup;
children = (
9E90D8611CEBBF2700FBBF40 /* libFlutterService.a */,
);
path = Library;
sourceTree = "<group>";
};
9E90D8631CEBCD7200FBBF40 /* Source */ = {
isa = PBXGroup;
children = (
9E90D8641CEBCD8400FBBF40 /* ServiceMain.cc */,
);
name = Source;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
9E90D84F1CEBBCEC00FBBF40 /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
9E90D8511CEBBCEC00FBBF40 /* FlutterService */ = {
isa = PBXNativeTarget;
buildConfigurationList = 9E90D85A1CEBBCED00FBBF40 /* Build configuration list for PBXNativeTarget "FlutterService" */;
buildPhases = (
9E90D84D1CEBBCEC00FBBF40 /* Sources */,
9E90D84E1CEBBCEC00FBBF40 /* Frameworks */,
9E90D84F1CEBBCEC00FBBF40 /* Headers */,
9E90D8501CEBBCEC00FBBF40 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = FlutterService;
productName = FlutterService;
productReference = 9E90D8521CEBBCEC00FBBF40 /* FlutterService.framework */;
productType = "com.apple.product-type.framework";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
9E90D8491CEBBCEC00FBBF40 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0730;
ORGANIZATIONNAME = Flutter;
TargetAttributes = {
9E90D8511CEBBCEC00FBBF40 = {
CreatedOnToolsVersion = 7.3;
};
};
};
buildConfigurationList = 9E90D84C1CEBBCEC00FBBF40 /* Build configuration list for PBXProject "FlutterService" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = 9E90D8481CEBBCEC00FBBF40;
productRefGroup = 9E90D8531CEBBCEC00FBBF40 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
9E90D8511CEBBCEC00FBBF40 /* FlutterService */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
9E90D8501CEBBCEC00FBBF40 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
9E90D84D1CEBBCEC00FBBF40 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
9E90D8651CEBCD8400FBBF40 /* ServiceMain.cc in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
9E90D8581CEBBCED00FBBF40 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = "$(SOURCE_ROOT)/Headers";
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Debug;
};
9E90D8591CEBBCED00FBBF40 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = "$(SOURCE_ROOT)/Headers";
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Release;
};
9E90D85B1CEBBCED00FBBF40 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = "$(SRCROOT)/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)$(LOCAL_LIBRARY_DIR)",
);
PRODUCT_BUNDLE_IDENTIFIER = io.flutter.flutterservice;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
};
name = Debug;
};
9E90D85C1CEBBCED00FBBF40 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = "$(SRCROOT)/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)$(LOCAL_LIBRARY_DIR)",
);
PRODUCT_BUNDLE_IDENTIFIER = io.flutter.flutterservice;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
9E90D84C1CEBBCEC00FBBF40 /* Build configuration list for PBXProject "FlutterService" */ = {
isa = XCConfigurationList;
buildConfigurations = (
9E90D8581CEBBCED00FBBF40 /* Debug */,
9E90D8591CEBBCED00FBBF40 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
9E90D85A1CEBBCED00FBBF40 /* Build configuration list for PBXNativeTarget "FlutterService" */ = {
isa = XCConfigurationList;
buildConfigurations = (
9E90D85B1CEBBCED00FBBF40 /* Debug */,
9E90D85C1CEBBCED00FBBF40 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 9E90D8491CEBBCEC00FBBF40 /* Project object */;
}
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:FlutterService.xcodeproj">
</FileRef>
</Workspace>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "mojo/public/cpp/bindings/strong_binding.h"
void FlutterServicePerform(mojo::ScopedMessagePipeHandle client_handle,
const mojo::String& service_name) {
// Your service implementation goes here.
}
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# A GN template used to process a Jinj2 template file.
template("render_template") {
set_sources_assignment_filter([])
assert(defined(invoker.template), "The template file to render.")
assert(defined(invoker.output), "The output of template expansion.")
assert(defined(invoker.variables), "The list of template variables.")
assert(defined(invoker.stamp_file), "The stamp file.")
action(target_name) {
if(defined(invoker.visibility)) {
visibility = invoker.visibility
}
script = "//sky/build/template.py"
sources = [ invoker.template ]
outputs = [
invoker.output,
invoker.stamp_file,
]
args = [
"--template",
rebase_path(invoker.template, root_build_dir),
"--output",
rebase_path(invoker.output, root_build_dir),
"--stamp",
rebase_path(invoker.stamp_file, root_build_dir),
]
args += invoker.variables
}
}
#!/usr/bin/env python
#
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
'''Renders a single template file using the Jinga templating engine.'''
import argparse
import sys
import os
import itertools
sys.path.append(os.path.join(os.path.dirname(__file__), '../../third_party'))
import jinja2
from jinja2 import Environment, FileSystemLoader
def make_stamp_file(stamp_path):
dir_name = os.path.dirname(stamp_path)
with open(stamp_path, 'a'):
os.utime(stamp_path, None)
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('--template', help='The template file to render')
parser.add_argument('--stamp', help='The template stamp file')
parser.add_argument('--output',
help='The output file to render the template to')
parser.add_argument('vars', metavar='V', nargs='+',
help='A list of key value pairs used as template args')
args = parser.parse_args()
template_file = os.path.abspath(args.template)
if not os.path.isfile(template_file):
print 'Cannot find file at path: ', template_file
return 1
env = jinja2.Environment(loader=FileSystemLoader('/'),
undefined=jinja2.StrictUndefined)
template = env.get_template(template_file)
variables = dict(itertools.izip_longest(*[iter(args.vars)] * 2, fillvalue=''))
output = template.render(variables)
with open(os.path.abspath(args.output), 'wb') as file:
file.write(output)
make_stamp_file(args.stamp)
if __name__ == '__main__':
main()
#!/usr/bin/env python
#
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
'''Zips up an entire directory.'''
import argparse
import shutil
import os
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('--input-directory',
required=True,
dest='input_dir',
help='The input directory.')
parser.add_argument('--output-archive',
required=True,
dest='output',
help='The path to the output archive.')
args = parser.parse_args()
input_dir = os.path.abspath(args.input_dir)
output = os.path.abspath(args.output)
if os.path.isfile(output):
os.remove(output)
temp_file = '%s' % output
shutil.make_archive(
temp_file,
'zip',
input_dir
)
shutil.move('%s.zip' % temp_file, output)
if __name__ == '__main__':
main()
#!/usr/bin/env python
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import argparse
import subprocess
import shutil
import sys
import os
def MakeStamp(stamp_path):
dir_name = os.path.dirname(stamp_path)
if not os.path.isdir(dir_name):
os.makedirs()
with open(stamp_path, 'a'):
os.utime(stamp_path, None)
def main():
parser = argparse.ArgumentParser(description='Copy a directory')
parser.add_argument('--src', type=str)
parser.add_argument('--dst', type=str)
parser.add_argument('--stamp', type=str)
args = parser.parse_args()
shutil.rmtree(args.dst, True)
shutil.copytree(args.src, args.dst)
MakeStamp(args.stamp)
if __name__ == '__main__':
sys.exit(main())
#!/usr/bin/env python
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
'''Creates the iOS native service SDK that developers can use the create
native services that can be dynamically loaded.'''
import errno
import os
import shutil
import sys
import argparse
import subprocess
def mkdir_p(path):
try:
os.makedirs(path)
except OSError as exc:
if exc.errno == errno.EEXIST and os.path.isdir(path):
pass
else:
raise
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('--simulator-out-dir',
dest='simulator_out_dir',
required=True,
help='The out directory for the simulator assets.')
parser.add_argument('--device-out-dir',
dest='device_out_dir',
required=True,
help='The out directory for the device assets.')
parser.add_argument('--dest',
dest='dest',
required=True,
help='The directory in which to create the SDK.')
parser.add_argument('--harness',
dest='harness',
required=True,
help='The SDK harness to use.')
parser.add_argument('headers',
metavar='H',
nargs='+',
help='A list of header directories to copy over to the SDK.')
args = parser.parse_args()
simulator_out_dir = os.path.abspath(args.simulator_out_dir)
device_out_dir = os.path.abspath(args.device_out_dir)
archive_path = 'obj/sky/services/dynamic/libFlutterService.a'
simulator_archive = os.path.join(simulator_out_dir, archive_path)
device_archive = os.path.join(device_out_dir, archive_path)
sdk_dir = os.path.join(os.path.abspath(args.dest), 'ServiceSDK')
if os.path.isdir(sdk_dir):
shutil.rmtree(sdk_dir)
shutil.copytree(os.path.abspath(args.harness), os.path.join(sdk_dir))
library_path = os.path.join(sdk_dir, 'Library')
header_path = os.path.join(sdk_dir, 'Headers')
mkdir_p(library_path)
mkdir_p(header_path)
subprocess.call([
'lipo',
simulator_archive,
device_archive,
'-create',
'-output',
os.path.join(library_path, 'libFlutterService.a'),
])
src_root = os.path.join(os.path.dirname(__file__), '../../')
for headers_dir in args.headers:
for root, _, files in os.walk(headers_dir):
for file in files:
if file.endswith(".h"):
source = os.path.abspath(os.path.join(root, file))
relative = os.path.relpath(source, src_root)
destination = os.path.abspath(os.path.join(header_path, relative))
destination_dir = os.path.dirname(destination)
mkdir_p(destination_dir)
shutil.copyfile(source, destination)
return 0
if __name__ == '__main__':
sys.exit(main())
#!/usr/bin/env python
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import argparse
import subprocess
import shutil
import sys
import os
def main():
parser = argparse.ArgumentParser(description='Creates the Flutter iOS SDK')
parser.add_argument('--dst', type=str, required=True)
parser.add_argument('--device-out-dir', type=str, required=True)
parser.add_argument('--simulator-out-dir', type=str, required=True)
args = parser.parse_args()
device_sdk = os.path.join(args.device_out_dir, 'Flutter')
simulator_sdk = os.path.join(args.simulator_out_dir, 'Flutter')
flutter_framework_binary = 'Flutter.framework/Flutter'
device_dylib = os.path.join(args.device_out_dir,
flutter_framework_binary)
simulator_dylib = os.path.join(args.simulator_out_dir,
flutter_framework_binary)
if not os.path.isdir(device_sdk):
print 'Cannot find iOS device SDK at', device_sdk
return 1
if not os.path.isdir(simulator_sdk):
print 'Cannot find iOS simulator SDK at', simulator_sdk
return 1
if not os.path.isfile(device_dylib):
print 'Cannot find iOS device dylib at', device_dylib
return 1
if not os.path.isfile(simulator_dylib):
print 'Cannot find iOS device dylib at', simulator_dylib
return 1
shutil.rmtree(args.dst, True)
shutil.copytree(device_sdk, args.dst)
sim_tools = 'Tools/iphonesimulator'
shutil.copytree(os.path.join(simulator_sdk, sim_tools),
os.path.join(args.dst, sim_tools))
subprocess.call([
'lipo',
device_dylib,
simulator_dylib,
'-create',
'-output',
os.path.join(args.dst, 'Tools/common/Flutter.framework/Flutter')
])
if __name__ == '__main__':
sys.exit(main())
#!/usr/bin/env python
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# See https://github.com/domokit/sky_engine/wiki/Release-process
import argparse
import os
import subprocess
import sys
import distutils.util
import tempfile
import zipfile
DRY_RUN = False
def run(cwd, args):
print 'RUNNING:', ' '.join(args), 'IN:', cwd
if DRY_RUN:
return
subprocess.check_call(args, cwd=cwd)
def confirm(prompt):
user_input = raw_input("%s (y/N) " % prompt)
try:
return distutils.util.strtobool(user_input) == 1
except ValueError:
return False
def git_revision(cwd):
return subprocess.check_output([
'git', 'rev-parse', 'HEAD',
], cwd=cwd).strip()
GS_URL = 'gs://mojo/flutter/%(commit_hash)s/%(config)s/%(name)s'
# Paths of the artifacts that will be packaged into a zip file.
ZIP_ARTIFACTS = {
'android-arm': [
'chromium-debug.keystore',
'icudtl.dat',
'dist/shell/SkyShell.apk',
'dist/shell/flutter.mojo',
'gen/sky/shell/shell/classes.dex.jar',
'gen/sky/shell/shell/shell/libs/armeabi-v7a/libsky_shell.so',
# TODO(mpcomplete): obsolete. Remove after updating the flutter tool.
'gen/sky/shell/shell/classes.dex',
],
'linux-x64': [
'dist/shell/icudtl.dat',
'dist/shell/sky_shell',
'dist/shell/sky_snapshot',
'dist/shell/flutter.mojo',
],
}
# Paths of the artifacts that will be uploaded to GCS as individual files.
FILE_ARTIFACTS = {
'android-arm': [
'dist/shell/flutter.mojo',
'dist/shell/libflutter_library.so',
],
'linux-x64': [
'dist/shell/flutter.mojo',
'dist/shell/libflutter_library.so',
],
}
def find_missing_artifacts(config, config_root):
result = []
for artifact_map in [ZIP_ARTIFACTS, FILE_ARTIFACTS]:
for artifact_path in artifact_map[config]:
full_path = os.path.join(config_root, artifact_path)
if not os.path.exists(full_path):
result.append(full_path)
return result
# Do not try to compress file types that are already compressed.
FILE_TYPE_COMPRESSION = {
'.apk': zipfile.ZIP_STORED,
}
def upload_artifacts(dist_root, config, commit_hash):
# Build and upload a zip file of artifacts
zip_fd, zip_filename = tempfile.mkstemp('.zip', 'artifacts_')
try:
os.close(zip_fd)
artifact_zip = zipfile.ZipFile(zip_filename, 'w')
for artifact_path in ZIP_ARTIFACTS[config]:
_, extension = os.path.splitext(artifact_path)
artifact_zip.write(os.path.join(dist_root, artifact_path),
os.path.basename(artifact_path),
FILE_TYPE_COMPRESSION.get(extension, zipfile.ZIP_DEFLATED))
artifact_zip.close()
dst = GS_URL % {
'config': config,
'commit_hash': commit_hash,
'name': 'artifacts.zip',
}
run(dist_root, ['gsutil', 'cp', zip_filename, dst])
finally:
os.remove(zip_filename)
# Upload individual file artifacts
for artifact_path in FILE_ARTIFACTS[config]:
dst = GS_URL % {
'config': config,
'commit_hash': commit_hash,
'name': os.path.basename(artifact_path),
}
z = ','.join([ 'mojo', 'so' ])
run(dist_root, ['gsutil', 'cp', '-z', z, artifact_path, dst])
def main():
parser = argparse.ArgumentParser(description='Deploy!')
parser.add_argument('--dry-run', action='store_true', default=False,
help='Just print commands w/o executing.')
parser.add_argument('--revision', help='The git revision to publish.')
args = parser.parse_args()
global DRY_RUN
DRY_RUN = args.dry_run
engine_root = os.path.abspath('.')
if not os.path.exists(os.path.join(engine_root, 'sky')):
print "Cannot find //sky. Is %s the Flutter engine repository?" % engine_root
return 1
commit_hash = git_revision(engine_root)
if commit_hash != args.revision:
print "Current revision %s does not match requested revision %s." % (commit_hash, args.revision)
print "Please update the current revision to %s." % args.revision
return 1
# Derived paths:
dart_sdk_root = os.path.join(engine_root, 'third_party/dart-sdk/dart-sdk')
pub_path = os.path.join(dart_sdk_root, 'bin/pub')
android_out_root = os.path.join(engine_root, 'out/android_Release')
linux_out_root = os.path.join(engine_root, 'out/Release')
sky_engine_package_root = os.path.join(android_out_root, 'dist/packages/sky_engine/sky_engine')
sky_services_package_root = os.path.join(android_out_root, 'dist/packages/sky_services/sky_services')
sky_engine_revision_file = os.path.join(sky_engine_package_root, 'lib', 'REVISION')
run(engine_root, ['sky/tools/gn', '--android', '--release'])
run(engine_root, ['ninja', '-C', 'out/android_Release', ':dist'])
run(engine_root, ['sky/tools/gn', '--release'])
run(engine_root, ['ninja', '-C', 'out/Release', ':dist'])
with open(sky_engine_revision_file, 'w') as stream:
stream.write(commit_hash)
configs = [('android-arm', android_out_root),
('linux-x64', linux_out_root)]
# Check for missing artifact files
missing_artifacts = []
for config, config_root in configs:
missing_artifacts.extend(find_missing_artifacts(config, config_root))
if missing_artifacts:
print ('Build is missing files:\n%s' %
'\n'.join('\t%s' % path for path in missing_artifacts))
return 1
# Upload artifacts
for config, config_root in configs:
upload_artifacts(config_root, config, commit_hash)
run(sky_engine_package_root, [pub_path, 'publish', '--force'])
run(sky_services_package_root, [pub_path, 'publish', '--force'])
if __name__ == '__main__':
sys.exit(main())
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册