浏览代码

android release arm64

/main
siyao 3 年前
当前提交
b925397f
共有 9 个文件被更改,包括 136 次插入25 次删除
  1. 3
      com.unity.uiwidgets/Runtime/Plugins/Android/libUIWidgets.so.meta
  2. 33
      engine/Build.bee.cs
  3. 30
      engine/Scripts/lib_build.py
  4. 6
      engine/Scripts/lib_build_android.sh
  5. 8
      com.unity.uiwidgets/Runtime/Plugins/Android/arm64.meta
  6. 81
      com.unity.uiwidgets/Runtime/Plugins/Android/arm64/libUIWidgets.so.meta

3
com.unity.uiwidgets/Runtime/Plugins/Android/libUIWidgets.so.meta


fileFormatVersion: 2
guid: 983c1f57f6a4847638f514f55f79c8b4
guid: 44a73cced101346fcadd6be5304e117d
PluginImporter:
externalObjects: {}
serializedVersion: 2

Exclude Editor: 1
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude WebGL: 1
Exclude Win: 1
Exclude Win64: 1
Exclude iOS: 1

33
engine/Build.bee.cs


}
//bee.exe mac
static void DeployAndroid()
static void DeployAndroid(bool isArm64 = false)
buildArm64 = isArm64;
Backend.Current.AddAliasDependency("android_debug", dep);
Backend.Current.AddAliasDependency(isArm64 ? "android_debug_arm64" : "android_debug", dep);
Backend.Current.AddAliasDependency("android_release", dep);
Backend.Current.AddAliasDependency(isArm64 ? "android_release_arm64" : "android_release", dep);
}
}

flutterRoot = Environment.GetEnvironmentVariable("USERPROFILE") + "/engine/src";
}
skiaRoot = flutterRoot + "/third_party/skia";
buildArchitexture = Environment.GetEnvironmentVariable("BUILD_ARCHITECTURE");
try
{

{
DeployMac();
DeployAndroid();
DeployAndroid(true);
DeployIOS();
}
}

private static string buildArchitexture;
private static bool buildArm64;
//this setting is disabled by default, don't change it unless you know what you are doing
//it must be set the same as the settings we choose to build the flutter txt library

"-fno-exceptions",
"-nostdlib"
};
if (buildArchitexture!= null && buildArchitexture.Equals("arm64"))
if (buildArm64)
{
flags.Add(new []
{

"-Wl,--whole-archive",
};
if (buildArchitexture!= null && buildArchitexture.Equals("arm64"))
if (buildArm64)
{
flags.Add(new []
{

else if (platform == UIWidgetsBuildTargetPlatform.android)
{
AndroidNdkToolchain androidToolchain = null;
if (buildArchitexture != null && buildArchitexture.Equals("arm64"))
if (buildArm64)
{
androidToolchain = ToolChain.Store.Android().r19().Arm64();
}

if(codegen == CodeGen.Debug)
{
var buildNP = np.SetupSpecificConfiguration(config, androidToolchain.DynamicLibraryFormat).DeployTo("build_debug");
var buildNP = np.SetupSpecificConfiguration(config, androidToolchain.DynamicLibraryFormat)
.DeployTo(buildArm64 ? "build_debug_arm64" : "build_debug");
var buildNP = np.SetupSpecificConfiguration(config, androidToolchain.DynamicLibraryFormat).DeployTo("build_release");
var buildNP = np.SetupSpecificConfiguration(config, androidToolchain.DynamicLibraryFormat)
.DeployTo(buildArm64 ? "build_release_64" : "build_release");
dependencies_release.Add(buildNP.Path);
}

{
if (c.CodeGen == CodeGen.Debug)
{
if (buildArchitexture != null && buildArchitexture == "arm64")
if (buildArm64)
{
return new PrecompiledLibrary[]
{

{
return new PrecompiledLibrary[]
{
new StaticLibrary(flutterRoot + "/out/android_release/obj/flutter/third_party/txt/libtxt_lib.a"),
new StaticLibrary(buildArm64 ?
flutterRoot + "/out/android_release_arm64/obj/flutter/third_party/txt/libtxt_lib.a"
:flutterRoot + "/out/android_release/obj/flutter/third_party/txt/libtxt_lib.a"
),
};
}
});

new SystemLibrary("GLESv2"),
new SystemLibrary("log"),
};
if (buildArchitexture != null && buildArchitexture == "arm64")
if (buildArm64)
{
libraries.Add(new PrecompiledLibrary[]
{

30
engine/Scripts/lib_build.py


ninja_params3=" -C out/" +output_path + " third_party/angle:libEGL_static"
elif runtime_mode == "release" and platform == "android":
optimize=""
output_path="android_release"
if architecture == "arm64":
output_path="android_release_arm64"
else:
output_path="android_release"
elif runtime_mode == "debug" and platform == "android":
optimize="--unoptimized"
if architecture == "arm64":

flutter_root_path = os.getenv('FLUTTER_ROOT_PATH')
else:
print("This environment variable has been set, skip")
if architecture == "arm64":
os.environ["BUILD_ARCHITECTURE"]="arm64";
env_path = os.getenv('PATH')
path_strings = re.split("[;:]", env_path)
for path in path_strings:

if runtime_mode == "release":
if os.path.exists(Path(work_path + "/../build_release")):
shutil.rmtree(Path(work_path + "/../build_release"))
if os.path.exists(Path(work_path + "/../build_release_arm64")):
shutil.rmtree(Path(work_path + "/../build_release_arm64"))
os.system("mono bee.exe " + platform +"_release")
copy_file(Path(work_path + "/../build_release/"), Path(work_path + "/../../com.unity.uiwidgets/Runtime/Plugins/" + dest_folder))
if platform == "android" and architecture == "arm64":
os.system("mono bee.exe " + platform +"_release_arm64")
else:
os.system("mono bee.exe " + platform +"_release")
if architecture == "arm64":
copy_file(Path(work_path + "/../build_release_arm64/"), Path(work_path + "/../../com.unity.uiwidgets/Runtime/Plugins/" + dest_folder))
else:
copy_file(Path(work_path + "/../build_release/"), Path(work_path + "/../../com.unity.uiwidgets/Runtime/Plugins/" + dest_folder))
if platform == "android":
tundra_file=Path(work_path + "/../artifacts/tundra.dag.json")
rsp = get_rsp(tundra_file, runtime_mode)

elif runtime_mode == "debug":
if os.path.exists(Path(work_path + "/../build_debug")):
shutil.rmtree(Path(work_path + "/../build_debug"))
if os.path.exists(Path(work_path + "/../build_debug")):
shutil.rmtree(Path(work_path + "/../build_debug"))
if platform == "android" and architecture == "arm64":
os.system("mono bee.exe " + platform +"_debug_arm64")
copy_file(Path(work_path + "/../build_debug/"), Path(work_path + "/../../com.unity.uiwidgets/Runtime/Plugins/" + dest_folder))
if architecture == "arm64":
copy_file(Path(work_path + "/../build_debug_arm64/"), Path(work_path + "/../../com.unity.uiwidgets/Runtime/Plugins/" + dest_folder))
else:
copy_file(Path(work_path + "/../build_debug/"), Path(work_path + "/../../com.unity.uiwidgets/Runtime/Plugins/" + dest_folder))
if platform == "ios":
print("\nStarting prlink library...")
os.chdir(Path(work_path + "/../"))

json_list = temp['Nodes']
target_files=''
for item in json_list:
if item['Annotation'].startswith('Link_Android_arm32') and item['Annotation'].find(runtime_mode) != -1:
if item['Annotation'].startswith('Link_Android_arm64' if architecture == "arm64" else 'Link_Android_arm32') and item['Annotation'].find(runtime_mode) != -1:
action_list = item['Inputs']
for o in action_list:
if o.endswith('.rsp'):

6
engine/Scripts/lib_build_android.sh


engine_path=$(pwd)
runtime_mode=release
architecture=false
architecture=32
while getopts ":r:m:a:" opt
do
case $opt in

runtime_mode=$OPTARG
;;
a)
architecture=true
architecture=$OPTARG
;;
?)
echo "unknown param"

if [ $architecture ]; then
if [ $architecture = "64" ]; then
python3 lib_build.py -r $engine_path -p android -m $runtime_mode --arm64
else
python3 lib_build.py -r $engine_path -p android -m $runtime_mode

8
com.unity.uiwidgets/Runtime/Plugins/Android/arm64.meta


fileFormatVersion: 2
guid: 50c2cf1b23d954ecfb07bb4ccbd9fd74
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

81
com.unity.uiwidgets/Runtime/Plugins/Android/arm64/libUIWidgets.so.meta


fileFormatVersion: 2
guid: 01e6709a425804d4d8c0f92544b01ce0
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 1
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
: Any
second:
enabled: 0
settings:
Exclude Android: 0
Exclude Editor: 1
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude WebGL: 1
Exclude Win: 1
Exclude Win64: 1
Exclude iOS: 1
- first:
Android: Android
second:
enabled: 1
settings:
CPU: ARM64
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
CPU: AnyCPU
DefaultValueInitialized: true
OS: AnyOS
- first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
- first:
iPhone: iOS
second:
enabled: 0
settings:
AddToEmbeddedBinaries: false
CPU: AnyCPU
CompileFlags:
FrameworkDependencies:
userData:
assetBundleName:
assetBundleVariant:

部分文件因为文件数量过多而无法显示

正在加载...
取消
保存