浏览代码

clean code

/siyaoH-1.17-PlatformMessage
siyao 4 年前
当前提交
9ab2e6a3
共有 14 个文件被更改,包括 52 次插入1187 次删除
  1. 5
      Samples/UIWidgetsSamples_2019_4/Assets/CountDemo.cs
  2. 8
      Samples/UIWidgetsSamples_2019_4/Assets/CountDemo.unity
  3. 2
      com.unity.uiwidgets/Runtime/engine2/UIWidgetsPanelWrapper.cs
  4. 2
      com.unity.uiwidgets/Runtime/ui2/native_bindings.cs
  5. 11
      engine/src/engine.cc
  6. 32
      Samples/UIWidgetsSamples_2019_4/Assets/AndroidWorkAround.cs
  7. 14
      com.unity.uiwidgets/Runtime/engine2/AndroidGLInit.cs
  8. 76
      Samples/UIWidgetsSamples_2019_4/Assets/ANT.cs
  9. 11
      Samples/UIWidgetsSamples_2019_4/Assets/ANT.cs.meta
  10. 471
      Samples/UIWidgetsSamples_2019_4/Assets/ANT.unity
  11. 7
      Samples/UIWidgetsSamples_2019_4/Assets/ANT.unity.meta
  12. 32
      Samples/UIWidgetsSamples_2019_4/Assets/WorkAround.cs
  13. 3
      com.unity.uiwidgets/Runtime/service.meta
  14. 565
      engine/build.py

5
Samples/UIWidgetsSamples_2019_4/Assets/CountDemo.cs


{
protected void OnEnable()
{
Debug.Log("???? on enable");
#if !UNITY_EDITOR
var vv = TestFloat();
Debug.Log($"?? {vv}");
#endif
base.OnEnable();
}

8
Samples/UIWidgetsSamples_2019_4/Assets/CountDemo.unity


m_Father: {fileID: 314921623}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_SizeDelta: {x: 500, y: 500}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &1777874942
CanvasRenderer:

m_Script: {fileID: 11500000, guid: bcb4984097885463dbe58d12837993ce, type: 3}
m_Name:
m_EditorClassIdentifier:
demo: {fileID: 1777874943}
panel: {fileID: 0}

2
com.unity.uiwidgets/Runtime/engine2/UIWidgetsPanelWrapper.cs


#region Platform: Windows Specific Functionalities
#if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN
#if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN
public partial class UIWidgetsPanelWrapper {
RenderTexture _renderTexture;

2
com.unity.uiwidgets/Runtime/ui2/native_bindings.cs


#if (UNITY_IOS || UNITY_TVOS || UNITY_WEBGL) && !UNITY_EDITOR
internal const string dllName = "__Internal";
#else
public const string dllName = "libUIWidgets_d";
internal const string dllName = "libUIWidgets_d";
#endif
}

11
engine/src/engine.cc


extern "C" void UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API UnityPluginUnload() {
uiwidgets::UIWidgetsSystem::GetInstancePtr()->UnBindUnityInterfaces();
}
extern "C" UNITY_INTERFACE_EXPORT UNITY_INTERFACE_API float TestFloat()
{
#if defined(__CYGWIN32__)
return 0.3f;
#elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(_WIN64) || defined(WINAPI_FAMILY)
return 0.2f;
#elif defined(__MACH__) || defined(__ANDROID__) || defined(__linux__) || defined(LUMIN)
return 0.1f;
#endif
}

32
Samples/UIWidgetsSamples_2019_4/Assets/AndroidWorkAround.cs


using engine2;
using UIWidgetsSample;
using Unity.UIWidgets.engine2;
using UnityEngine;
namespace Unity.UIWidgets.ui
{
public class AndroidWorkAround : MonoBehaviour
{
public UIWidgetsPanel panel;
// Start is called before the first frame update
void Start()
{
panel = GetComponent<UIWidgetsPanel>();
panel.enabled = false;
AndroidGLInit.Init();
}
// Update is called once per frame
void Update()
{
if (!panel.enabled)
{
panel.enabled = true;
enabled = false;
}
}
}
}

14
com.unity.uiwidgets/Runtime/engine2/AndroidGLInit.cs


using System.Runtime.InteropServices;
using Unity.UIWidgets.ui;
using UnityEngine;
namespace engine2 {
public class AndroidGLInit {
[DllImport(NativeBindings.dllName)]
static extern System.IntPtr GetUnityContextEventFunc();
public static void Init() {
GL.IssuePluginEvent(GetUnityContextEventFunc(), 1);
}
}
}

76
Samples/UIWidgetsSamples_2019_4/Assets/ANT.cs


using System.Collections;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using Unity.UIWidgets.ui;
using UnityEngine;
using Color = UnityEngine.Color;
public class ANT : MonoBehaviour
{
#if (UNITY_IOS || UNITY_TVOS || UNITY_WEBGL) && !UNITY_EDITOR
[DllImport ("__Internal")]
#else
[DllImport ("libUIWidgets_d")]
#endif
private static extern System.IntPtr SetTextureFromUnity2(System.IntPtr texture, int w, int h);
#if (UNITY_IOS || UNITY_TVOS || UNITY_WEBGL) && !UNITY_EDITOR
[DllImport ("__Internal")]
#else
[DllImport ("libUIWidgets_d")]
#endif
private static extern void draw_xxx();
#if (UNITY_IOS || UNITY_TVOS || UNITY_WEBGL) && !UNITY_EDITOR
[DllImport ("__Internal")]
#else
[DllImport ("libUIWidgets_d")]
#endif
private static extern System.IntPtr GetRenderEventFunc();
// Start is called before the first frame update
IEnumerator Start()
{
CreateTextureAndPassToPlugin();
yield return StartCoroutine("CallPluginAtEndOfFrames");
}
private void CreateTextureAndPassToPlugin()
{
var width = 256;
var height = 256;
Texture2D tex = new Texture2D(width,height,TextureFormat.ARGB32,false);
// Set point filtering just so we can see the pixels clearly
tex.filterMode = FilterMode.Point;
// Call Apply() so it's actually uploaded to the GPU
tex.Apply();
// Set texture onto our material
GetComponent<Renderer>().material.mainTexture = tex;
// #if !UNITY_EDITOR
// // Pass texture pointer to the plugin
System.IntPtr ptr = SetTextureFromUnity2 (tex.GetNativeTexturePtr(), tex.width, tex.height);
GL.IssuePluginEvent(GetRenderEventFunc(), 1);
if (ptr != System.IntPtr.Zero)
{
var texEx = Texture2D.CreateExternalTexture(width, height, TextureFormat.BGRA32, false, true, ptr);
GetComponent<Renderer>().material.mainTexture = texEx;
}
// GL.IssuePluginEvent(GetRenderEventFunc(), 1);
// #endif
}
private IEnumerator CallPluginAtEndOfFrames()
{
while (true)
{
// Wait until all frame rendering is done
yield return new WaitForEndOfFrame();
#if !UNITY_EDITOR
// GL.IssuePluginEvent(GetRenderEventFunc(), 1);
draw_xxx();
#endif
}
}
}

11
Samples/UIWidgetsSamples_2019_4/Assets/ANT.cs.meta


fileFormatVersion: 2
guid: aa747e6fb83a24dc9a775f403f818d85
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

471
Samples/UIWidgetsSamples_2019_4/Assets/ANT.unity


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
OcclusionCullingSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
m_SceneGUID: 00000000000000000000000000000000
m_OcclusionCullingData: {fileID: 0}
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 9
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
m_FogDensity: 0.01
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
m_AmbientIntensity: 1
m_AmbientMode: 0
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
m_HaloStrength: 0.5
m_FlareStrength: 1
m_FlareFadeSpeed: 3
m_HaloTexture: {fileID: 0}
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
m_DefaultReflectionMode: 0
m_DefaultReflectionResolution: 128
m_ReflectionBounces: 1
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 11
m_GIWorkflowMode: 1
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 0
m_LightmapEditorSettings:
serializedVersion: 12
m_Resolution: 2
m_BakeResolution: 40
m_AtlasSize: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_ExtractAmbientOcclusion: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 1
m_FinalGather: 0
m_FinalGatherFiltering: 1
m_FinalGatherRayCount: 256
m_ReflectionCompression: 2
m_MixedBakeMode: 2
m_BakeBackend: 1
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 512
m_PVRBounces: 2
m_PVREnvironmentSampleCount: 256
m_PVREnvironmentReferencePointCount: 2048
m_PVRFilteringMode: 1
m_PVRDenoiserTypeDirect: 1
m_PVRDenoiserTypeIndirect: 1
m_PVRDenoiserTypeAO: 1
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVREnvironmentMIS: 1
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ExportTrainingData: 0
m_TrainingDataDestination: TrainingData
m_LightProbeSampleCountMultiplier: 4
m_LightingDataAsset: {fileID: 0}
m_UseShadowmask: 1
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 2
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
minRegionArea: 2
manualCellSize: 0
cellSize: 0.16666667
manualTileSize: 0
tileSize: 256
accuratePlacement: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &156821295
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 156821298}
- component: {fileID: 156821297}
- component: {fileID: 156821296}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!81 &156821296
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 156821295}
m_Enabled: 1
--- !u!20 &156821297
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 156821295}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_projectionMatrixMode: 1
m_GateFitMode: 2
m_FOVAxisMode: 0
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_FocalLength: 50
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 0
orthographic size: 5
m_Depth: -1
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 1
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!4 &156821298
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 156821295}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1206932713
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1206932716}
- component: {fileID: 1206932715}
- component: {fileID: 1206932714}
m_Layer: 0
m_Name: EventSystem
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1206932714
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1206932713}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3}
m_Name:
m_EditorClassIdentifier:
m_HorizontalAxis: Horizontal
m_VerticalAxis: Vertical
m_SubmitButton: Submit
m_CancelButton: Cancel
m_InputActionsPerSecond: 10
m_RepeatDelay: 0.5
m_ForceModuleActive: 0
--- !u!114 &1206932715
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1206932713}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3}
m_Name:
m_EditorClassIdentifier:
m_FirstSelected: {fileID: 0}
m_sendNavigationEvents: 1
m_DragThreshold: 10
--- !u!4 &1206932716
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1206932713}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1313087942
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1313087946}
- component: {fileID: 1313087945}
- component: {fileID: 1313087944}
- component: {fileID: 1313087943}
- component: {fileID: 1313087947}
m_Layer: 0
m_Name: Plane
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!64 &1313087943
MeshCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1313087942}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 4
m_Convex: 0
m_CookingOptions: 30
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &1313087944
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1313087942}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10302, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!33 &1313087945
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1313087942}
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &1313087946
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1313087942}
m_LocalRotation: {x: -0.7071068, y: 0, z: 0, w: 0.7071068}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: -90, y: 0, z: 0}
--- !u!114 &1313087947
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1313087942}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: aa747e6fb83a24dc9a775f403f818d85, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &1953640782
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1953640784}
- component: {fileID: 1953640783}
m_Layer: 0
m_Name: Directional Light
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!108 &1953640783
Light:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1953640782}
m_Enabled: 1
serializedVersion: 10
m_Type: 1
m_Shape: 0
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_Intensity: 1
m_Range: 10
m_SpotAngle: 30
m_InnerSpotAngle: 21.802082
m_CookieSize: 10
m_Shadows:
m_Type: 2
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
m_CullingMatrixOverride:
e00: 1
e01: 0
e02: 0
e03: 0
e10: 0
e11: 1
e12: 0
e13: 0
e20: 0
e21: 0
e22: 1
e23: 0
e30: 0
e31: 0
e32: 0
e33: 1
m_UseCullingMatrixOverride: 0
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingLayerMask: 1
m_Lightmapping: 4
m_LightShadowCasterMode: 0
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_ColorTemperature: 6570
m_UseColorTemperature: 0
m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
m_UseBoundingSphereOverride: 0
m_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!4 &1953640784
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1953640782}
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
m_LocalPosition: {x: 0, y: 3, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}

7
Samples/UIWidgetsSamples_2019_4/Assets/ANT.unity.meta


fileFormatVersion: 2
guid: 0f4091ef47c8c4d9f9e6b68acb464c91
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

32
Samples/UIWidgetsSamples_2019_4/Assets/WorkAround.cs


using System.Collections;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using UIWidgetsSample;
using Unity.UIWidgets.ui;
using UnityEngine;
public class WorkAround : MonoBehaviour
{
[DllImport(NativeBindings.dllName)]
static extern System.IntPtr GetUnityContextEventFunc();
public CountDemo demo;
// Start is called before the first frame update
void Start()
{
GL.IssuePluginEvent(GetUnityContextEventFunc(), 1);
// demo = GetComponent<CountDemo>();
}
// Update is called once per frame
void Update()
{
if (!demo.enabled)
{
demo.enabled = true;
this.enabled = false;
}
}
}

3
com.unity.uiwidgets/Runtime/service.meta


fileFormatVersion: 2
guid: 355cc83db152457b8eb6da935c588fbc
timeCreated: 1536566821

565
engine/build.py


import subprocess
import os
import sys
def runCmd(cmds, log = False):
process = subprocess.Popen(
cmds,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE
)
stdout, stderr = process.communicate()
if log:
print("out:"+stdout)
print("err:"+stderr)
return stdout, stderr
linkOnly = len(sys.argv) > 1
buildEngine = linkOnly and (sys.argv[1] == 'e')
FLUTTER_ROOT = os.environ['FLUTTER_ROOT']
SKIA_ROOT = FLUTTER_ROOT+"/third_party/skia"
clang = FLUTTER_ROOT+"/buildtools/mac-x64/clang/bin/clang++"
clang = "artifacts/Stevedore/android-ndk-mac/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++"
codeFiles = [
"src/shell/platform/unity/android/unity_surface_manager.cc",
"src/shell/platform/unity/android/uiwidgets_system.cc",
"src/shell/platform/unity/android/cocoa_task_runner.cc",
"src/shell/platform/unity/android/uiwidgets_panel.cc",
"src/assets/asset_manager.cc",
"src/assets/asset_manager.h",
"src/assets/asset_resolver.h",
"src/assets/directory_asset_bundle.cc",
"src/assets/directory_asset_bundle.h",
"src/common/settings.cc",
"src/common/settings.h",
"src/common/task_runners.cc",
"src/common/task_runners.h",
"src/flow/layers/backdrop_filter_layer.cc",
"src/flow/layers/backdrop_filter_layer.h",
"src/flow/layers/clip_path_layer.cc",
"src/flow/layers/clip_path_layer.h",
"src/flow/layers/clip_rect_layer.cc",
"src/flow/layers/clip_rect_layer.h",
"src/flow/layers/clip_rrect_layer.cc",
"src/flow/layers/clip_rrect_layer.h",
"src/flow/layers/color_filter_layer.cc",
"src/flow/layers/color_filter_layer.h",
"src/flow/layers/container_layer.cc",
"src/flow/layers/container_layer.h",
"src/flow/layers/image_filter_layer.cc",
"src/flow/layers/image_filter_layer.h",
"src/flow/layers/layer.cc",
"src/flow/layers/layer.h",
"src/flow/layers/layer_tree.cc",
"src/flow/layers/layer_tree.h",
"src/flow/layers/opacity_layer.cc",
"src/flow/layers/opacity_layer.h",
"src/flow/layers/performance_overlay_layer.cc",
"src/flow/layers/performance_overlay_layer.h",
"src/flow/layers/physical_shape_layer.cc",
"src/flow/layers/physical_shape_layer.h",
"src/flow/layers/picture_layer.cc",
"src/flow/layers/picture_layer.h",
"src/flow/layers/platform_view_layer.cc",
"src/flow/layers/platform_view_layer.h",
"src/flow/layers/shader_mask_layer.cc",
"src/flow/layers/shader_mask_layer.h",
"src/flow/layers/texture_layer.cc",
"src/flow/layers/texture_layer.h",
"src/flow/layers/transform_layer.cc",
"src/flow/layers/transform_layer.h",
"src/flow/compositor_context.cc",
"src/flow/compositor_context.h",
"src/flow/embedded_views.cc",
"src/flow/embedded_views.h",
"src/flow/instrumentation.cc",
"src/flow/instrumentation.h",
"src/flow/matrix_decomposition.cc",
"src/flow/matrix_decomposition.h",
"src/flow/paint_utils.cc",
"src/flow/paint_utils.h",
"src/flow/raster_cache.cc",
"src/flow/raster_cache.h",
"src/flow/raster_cache_key.cc",
"src/flow/raster_cache_key.h",
"src/flow/rtree.cc",
"src/flow/rtree.h",
"src/flow/skia_gpu_object.cc",
"src/flow/skia_gpu_object.h",
"src/flow/texture.cc",
"src/flow/texture.h",
"src/lib/ui/compositing/scene.cc",
"src/lib/ui/compositing/scene.h",
"src/lib/ui/compositing/scene_builder.cc",
"src/lib/ui/compositing/scene_builder.h",
"src/lib/ui/text/icu_util.h",
"src/lib/ui/text/icu_util.cc",
"src/lib/ui/text/asset_manager_font_provider.cc",
"src/lib/ui/text/asset_manager_font_provider.h",
"src/lib/ui/text/paragraph_builder.cc",
"src/lib/ui/text/paragraph_builder.h",
"src/lib/ui/text/font_collection.cc",
"src/lib/ui/text/font_collection.h",
"src/lib/ui/text/paragraph.cc",
"src/lib/ui/text/paragraph.h",
"src/lib/ui/painting/canvas.cc",
"src/lib/ui/painting/canvas.h",
"src/lib/ui/painting/codec.cc",
"src/lib/ui/painting/codec.h",
"src/lib/ui/painting/color_filter.cc",
"src/lib/ui/painting/color_filter.h",
"src/lib/ui/painting/engine_layer.cc",
"src/lib/ui/painting/engine_layer.h",
"src/lib/ui/painting/frame_info.cc",
"src/lib/ui/painting/frame_info.h",
"src/lib/ui/painting/gradient.cc",
"src/lib/ui/painting/gradient.h",
"src/lib/ui/painting/image.cc",
"src/lib/ui/painting/image.h",
"src/lib/ui/painting/image_decoder.cc",
"src/lib/ui/painting/image_decoder.h",
"src/lib/ui/painting/image_encoding.cc",
"src/lib/ui/painting/image_encoding.h",
"src/lib/ui/painting/image_filter.cc",
"src/lib/ui/painting/image_filter.h",
"src/lib/ui/painting/image_shader.cc",
"src/lib/ui/painting/image_shader.h",
"src/lib/ui/painting/matrix.cc",
"src/lib/ui/painting/matrix.h",
"src/lib/ui/painting/multi_frame_codec.cc",
"src/lib/ui/painting/multi_frame_codec.h",
"src/lib/ui/painting/path.cc",
"src/lib/ui/painting/path.h",
"src/lib/ui/painting/path_measure.cc",
"src/lib/ui/painting/path_measure.h",
"src/lib/ui/painting/paint.cc",
"src/lib/ui/painting/paint.h",
"src/lib/ui/painting/picture.cc",
"src/lib/ui/painting/picture.h",
"src/lib/ui/painting/picture_recorder.cc",
"src/lib/ui/painting/picture_recorder.h",
"src/lib/ui/painting/rrect.cc",
"src/lib/ui/painting/rrect.h",
"src/lib/ui/painting/shader.cc",
"src/lib/ui/painting/shader.h",
"src/lib/ui/painting/single_frame_codec.cc",
"src/lib/ui/painting/single_frame_codec.h",
# "src/lib/ui/painting/skottie.cc",
# "src/lib/ui/painting/skottie.h",
"src/lib/ui/painting/vertices.cc",
"src/lib/ui/painting/vertices.h",
"src/lib/ui/window/platform_message_response_mono.cc",
"src/lib/ui/window/platform_message_response_mono.h",
"src/lib/ui/window/platform_message_response.cc",
"src/lib/ui/window/platform_message_response.h",
"src/lib/ui/window/platform_message.cc",
"src/lib/ui/window/platform_message.h",
"src/lib/ui/window/pointer_data.cc",
"src/lib/ui/window/pointer_data.h",
"src/lib/ui/window/pointer_data_packet.cc",
"src/lib/ui/window/pointer_data_packet.h",
"src/lib/ui/window/pointer_data_packet_converter.cc",
"src/lib/ui/window/pointer_data_packet_converter.h",
"src/lib/ui/window/viewport_metrics.cc",
"src/lib/ui/window/viewport_metrics.h",
"src/lib/ui/window/window.cc",
"src/lib/ui/window/window.h",
"src/lib/ui/io_manager.h",
"src/lib/ui/snapshot_delegate.h",
"src/lib/ui/ui_mono_state.cc",
"src/lib/ui/ui_mono_state.h",
"src/runtime/mono_api.cc",
"src/runtime/mono_api.h",
"src/runtime/mono_isolate.cc",
"src/runtime/mono_isolate.h",
"src/runtime/mono_isolate_scope.cc",
"src/runtime/mono_isolate_scope.h",
"src/runtime/mono_microtask_queue.cc",
"src/runtime/mono_microtask_queue.h",
"src/runtime/mono_state.cc",
"src/runtime/mono_state.h",
"src/runtime/runtime_controller.cc",
"src/runtime/runtime_controller.h",
"src/runtime/runtime_delegate.cc",
"src/runtime/runtime_delegate.h",
"src/runtime/start_up.cc",
"src/runtime/start_up.h",
"src/runtime/window_data.cc",
"src/runtime/window_data.h",
"src/shell/common/animator.cc",
"src/shell/common/animator.h",
"src/shell/common/canvas_spy.cc",
"src/shell/common/canvas_spy.h",
"src/shell/common/engine.cc",
"src/shell/common/engine.h",
"src/shell/common/lists.h",
"src/shell/common/lists.cc",
"src/shell/common/persistent_cache.cc",
"src/shell/common/persistent_cache.h",
"src/shell/common/pipeline.cc",
"src/shell/common/pipeline.h",
"src/shell/common/platform_view.cc",
"src/shell/common/platform_view.h",
"src/shell/common/pointer_data_dispatcher.cc",
"src/shell/common/pointer_data_dispatcher.h",
"src/shell/common/rasterizer.cc",
"src/shell/common/rasterizer.h",
"src/shell/common/run_configuration.cc",
"src/shell/common/run_configuration.h",
"src/shell/common/shell.cc",
"src/shell/common/shell.h",
"src/shell/common/shell_io_manager.cc",
"src/shell/common/shell_io_manager.h",
"src/shell/common/surface.cc",
"src/shell/common/surface.h",
"src/shell/common/switches.cc",
"src/shell/common/switches.h",
"src/shell/common/thread_host.cc",
"src/shell/common/thread_host.h",
"src/shell/common/vsync_waiter.cc",
"src/shell/common/vsync_waiter.h",
"src/shell/common/vsync_waiter_fallback.cc",
"src/shell/common/vsync_waiter_fallback.h",
"src/shell/gpu/gpu_surface_delegate.h",
"src/shell/gpu/gpu_surface_gl.cc",
"src/shell/gpu/gpu_surface_gl.h",
"src/shell/gpu/gpu_surface_gl_delegate.cc",
"src/shell/gpu/gpu_surface_gl_delegate.h",
"src/shell/gpu/gpu_surface_software.cc",
"src/shell/gpu/gpu_surface_software.h",
"src/shell/gpu/gpu_surface_software_delegate.cc",
"src/shell/gpu/gpu_surface_software_delegate.h",
"src/shell/platform/embedder/embedder.cc",
"src/shell/platform/embedder/embedder.h",
"src/shell/platform/embedder/embedder_engine.cc",
"src/shell/platform/embedder/embedder_engine.h",
"src/shell/platform/embedder/embedder_external_texture_gl.cc",
"src/shell/platform/embedder/embedder_external_texture_gl.h",
"src/shell/platform/embedder/embedder_external_view.cc",
"src/shell/platform/embedder/embedder_external_view.h",
"src/shell/platform/embedder/embedder_external_view_embedder.cc",
"src/shell/platform/embedder/embedder_external_view_embedder.h",
"src/shell/platform/embedder/embedder_layers.cc",
"src/shell/platform/embedder/embedder_layers.h",
"src/shell/platform/embedder/embedder_platform_message_response.cc",
"src/shell/platform/embedder/embedder_platform_message_response.h",
"src/shell/platform/embedder/embedder_render_target.cc",
"src/shell/platform/embedder/embedder_render_target.h",
"src/shell/platform/embedder/embedder_render_target_cache.cc",
"src/shell/platform/embedder/embedder_render_target_cache.h",
"src/shell/platform/embedder/embedder_surface.cc",
"src/shell/platform/embedder/embedder_surface.h",
"src/shell/platform/embedder/embedder_surface_gl.cc",
"src/shell/platform/embedder/embedder_surface_gl.h",
"src/shell/platform/embedder/embedder_surface_software.cc",
"src/shell/platform/embedder/embedder_surface_software.h",
"src/shell/platform/embedder/embedder_task_runner.cc",
"src/shell/platform/embedder/embedder_task_runner.h",
"src/shell/platform/embedder/embedder_thread_host.cc",
"src/shell/platform/embedder/embedder_thread_host.h",
"src/shell/platform/embedder/platform_view_embedder.cc",
"src/shell/platform/embedder/platform_view_embedder.h",
"src/shell/platform/embedder/vsync_waiter_embedder.cc",
"src/shell/platform/embedder/vsync_waiter_embedder.h",
"src/shell/platform/unity/gfx_worker_task_runner.cc",
"src/shell/platform/unity/gfx_worker_task_runner.h",
"src/shell/platform/unity/uiwidgets_system.h",
"src/shell/platform/unity/unity_console.cc",
"src/shell/platform/unity/unity_console.h",
"src/shell/version/version.cc",
"src/shell/version/version.h",
"src/engine.cc",
"src/platform_base.h"
]
objs = [
# icudtl
"icudtl.o",
# libcxx
FLUTTER_ROOT+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.algorithm.o",
FLUTTER_ROOT+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.any.o",
FLUTTER_ROOT+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.bind.o",
FLUTTER_ROOT+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.charconv.o",
FLUTTER_ROOT+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.chrono.o",
FLUTTER_ROOT+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.condition_variable.o",
FLUTTER_ROOT+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.condition_variable_destructor.o",
FLUTTER_ROOT+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.debug.o",
FLUTTER_ROOT+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.exception.o",
FLUTTER_ROOT+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.functional.o",
FLUTTER_ROOT+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.future.o",
FLUTTER_ROOT+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.hash.o",
FLUTTER_ROOT+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.ios.o",
FLUTTER_ROOT+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.iostream.o",
FLUTTER_ROOT+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.locale.o",
FLUTTER_ROOT+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.memory.o",
FLUTTER_ROOT+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.mutex.o",
FLUTTER_ROOT+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.mutex_destructor.o",
FLUTTER_ROOT+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.new.o",
FLUTTER_ROOT+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.optional.o",
FLUTTER_ROOT+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.random.o",
FLUTTER_ROOT+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.regex.o",
FLUTTER_ROOT+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.shared_mutex.o",
FLUTTER_ROOT+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.stdexcept.o",
FLUTTER_ROOT+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.string.o",
FLUTTER_ROOT+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.strstream.o",
FLUTTER_ROOT+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.system_error.o",
FLUTTER_ROOT+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.thread.o",
FLUTTER_ROOT+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.typeinfo.o",
FLUTTER_ROOT+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.utility.o",
FLUTTER_ROOT+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.valarray.o",
FLUTTER_ROOT+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.variant.o",
FLUTTER_ROOT+"/out/android_debug_unopt/obj/third_party/libcxx/src/libcxx.vector.o",
# libcxxabi
FLUTTER_ROOT+"/out/android_debug_unopt/obj/third_party/libcxxabi/src/libcxxabi.abort_message.o",
FLUTTER_ROOT+"/out/android_debug_unopt/obj/third_party/libcxxabi/src/libcxxabi.cxa_aux_runtime.o",
FLUTTER_ROOT+"/out/android_debug_unopt/obj/third_party/libcxxabi/src/libcxxabi.cxa_default_handlers.o",
FLUTTER_ROOT+"/out/android_debug_unopt/obj/third_party/libcxxabi/src/libcxxabi.cxa_demangle.o",
FLUTTER_ROOT+"/out/android_debug_unopt/obj/third_party/libcxxabi/src/libcxxabi.cxa_exception_storage.o",
FLUTTER_ROOT+"/out/android_debug_unopt/obj/third_party/libcxxabi/src/libcxxabi.cxa_guard.o",
FLUTTER_ROOT+"/out/android_debug_unopt/obj/third_party/libcxxabi/src/libcxxabi.cxa_handlers.o",
FLUTTER_ROOT+"/out/android_debug_unopt/obj/third_party/libcxxabi/src/libcxxabi.cxa_noexception.o",
FLUTTER_ROOT+"/out/android_debug_unopt/obj/third_party/libcxxabi/src/libcxxabi.cxa_unexpected.o",
FLUTTER_ROOT+"/out/android_debug_unopt/obj/third_party/libcxxabi/src/libcxxabi.cxa_vector.o",
FLUTTER_ROOT+"/out/android_debug_unopt/obj/third_party/libcxxabi/src/libcxxabi.cxa_virtual.o",
FLUTTER_ROOT+"/out/android_debug_unopt/obj/third_party/libcxxabi/src/libcxxabi.fallback_malloc.o",
FLUTTER_ROOT+"/out/android_debug_unopt/obj/third_party/libcxxabi/src/libcxxabi.private_typeinfo.o",
FLUTTER_ROOT+"/out/android_debug_unopt/obj/third_party/libcxxabi/src/libcxxabi.stdlib_exception.o",
FLUTTER_ROOT+"/out/android_debug_unopt/obj/third_party/libcxxabi/src/libcxxabi.stdlib_stdexcept.o",
FLUTTER_ROOT+"/out/android_debug_unopt/obj/third_party/libcxxabi/src/libcxxabi.stdlib_typeinfo.o",
]
# compile uiwidgets object
for codeFile in codeFiles:
div = codeFile.rfind("/")+1
dir = codeFile[0:div-1]
fileName = codeFile[div::]
div = fileName.index(".")
name = fileName[0:div]
extention = fileName[div::]
if extention != ".cc":
continue
FLUTTER_ROOT = FLUTTER_ROOT+""
mkdirScript = ["mkdir", "-p", "obj/"+dir]
process = subprocess.Popen(
mkdirScript, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, stderr = process.communicate()
buildScript = [
clang,
"-MD",
"-MF",
"obj/"+dir+"/"+name+".o.d",
"-DUSE_OPENSSL=1",
"-DUSE_OPENSSL_CERTS=1",
"-DANDROID",
"-DHAVE_SYS_UIO_H",
"-D__STDC_CONSTANT_MACROS",
"-D__STDC_FORMAT_MACROS",
"-D_FORTIFY_SOURCE=2",
"-D__compiler_offsetof=__builtin_offsetof",
"-Dnan=__builtin_nan",
"-D__GNU_SOURCE=1",
"-D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS",
"-D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS",
"-D_DEBUG",
"-DU_USING_ICU_NAMESPACE=0",
"-DU_ENABLE_DYLOAD=0",
"-DUSE_CHROMIUM_ICU=1",
"-DU_STATIC_IMPLEMENTATION",
"-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE",
"-DUCHAR_TYPE=uint16_t",
"-DFLUTTER_RUNTIME_MODE_DEBUG=1",
"-DFLUTTER_RUNTIME_MODE_PROFILE=2",
"-DFLUTTER_RUNTIME_MODE_RELEASE=3",
"-DFLUTTER_RUNTIME_MODE_JIT_RELEASE=4",
"-DFLUTTER_RUNTIME_MODE=1",
"-DFLUTTER_JIT_RUNTIME=1",
# confige for rapidjson
"-DUIWIDGETS_FORCE_ALIGNAS_8=\"1\"",
"-DRAPIDJSON_HAS_STDSTRING",
"-DRAPIDJSON_HAS_CXX11_RANGE_FOR",
"-DRAPIDJSON_HAS_CXX11_RVALUE_REFS",
"-DRAPIDJSON_HAS_CXX11_TYPETRAITS",
"-DRAPIDJSON_HAS_CXX11_NOEXCEPT",
"-DSK_ENABLE_SPIRV_VALIDATION",
"-DSK_GAMMA_APPLY_TO_A8",
"-DSK_GAMMA_EXPONENT=1.4",
"-DSK_GAMMA_CONTRAST=0.0",
"-DSK_ALLOW_STATIC_GLOBAL_INITIALIZERS=1",
"-DGR_TEST_UTILS=1",
"-DSKIA_IMPLEMENTATION=1",
"-DSK_GL",
"-DSK_ENABLE_DUMP_GPU",
"-DSK_SUPPORT_PDF",
"-DSK_CODEC_DECODES_JPEG",
"-DSK_ENCODE_JPEG",
"-DSK_ENABLE_ANDROID_UTILS",
"-DSK_USE_LIBGIFCODEC",
"-DSK_HAS_HEIF_LIBRARY",
"-DSK_CODEC_DECODES_PNG",
"-DSK_ENCODE_PNG",
"-DSK_CODEC_DECODES_RAW",
"-DSK_ENABLE_SKSL_INTERPRETER",
"-DSK_CODEC_DECODES_WEBP",
"-DSK_ENCODE_WEBP",
"-DSK_XML",
"-DUIWIDGETS_ENGINE_VERSION=\"0.0\"",
"-DSKIA_VERSION=\"0.0\"",
"-DXML_STATIC",
"-I.",
"-Ithird_party",
"-Isrc",
"-I"+FLUTTER_ROOT,
"-I"+FLUTTER_ROOT+"/third_party/rapidjson/include",
"-I"+SKIA_ROOT,
"-I"+SKIA_ROOT + "/include/third_party/vulkan",
"-I"+FLUTTER_ROOT+"/flutter/third_party/txt/src",
"-I" + FLUTTER_ROOT + "/third_party/harfbuzz/src",
"-I" + SKIA_ROOT + "/third_party/externals/icu/source/common",
# "-Igen",
"-I"+FLUTTER_ROOT+"/third_party/libcxx/include",
"-I"+FLUTTER_ROOT+"/third_party/libcxxabi/include",
"-I"+FLUTTER_ROOT+"/third_party/icu/source/common",
"-I"+FLUTTER_ROOT+"/third_party/icu/source/i18n",
# ignore deprecated code
"-Wno-deprecated-declarations",
"-fno-strict-aliasing",
"-march=armv7-a",
"-mfloat-abi=softfp",
"-mtune=generic-armv7-a",
"-mthumb",
"-fPIC",
"-pipe",
"-fcolor-diagnostics",
"-ffunction-sections",
"-funwind-tables",
"-fno-short-enums",
"-nostdinc++",
"--target=arm-linux-androideabi",
"-mfpu=neon",
"-Wall",
"-Wextra",
"-Wendif-labels",
"-Werror",
"-Wno-missing-field-initializers",
"-Wno-unused-parameter",
"-Wno-unused-variable",
# "-Wno-non-c-typedef-for-linkage",
"-isystem"+FLUTTER_ROOT+"/third_party/android_tools/ndk/sources/android/support/include",
"-isystem"+FLUTTER_ROOT +
"/third_party/android_tools/ndk/sysroot/usr/include/arm-linux-androideabi",
"-D__ANDROID_API__=16",
# "-fvisibility=hidden",
"--sysroot="+FLUTTER_ROOT+"/third_party/android_tools/ndk/sysroot",
"-Wstring-conversion",
# supress new line error
# "-Wnewline-eof",
"-O0",
"-g2",
"-fvisibility-inlines-hidden",
"-std=c++17",
"-fno-rtti",
"-fno-exceptions",
"-c",
dir+"/" + name + extention,
"-o",
"obj/"+dir+"/"+name+".o",
]
objs.append("obj/"+dir+"/"+name+".o")
if linkOnly and (buildEngine == False):
continue
if buildEngine and name != 'engine':
continue
print(codeFile)
_, stderr = runCmd(buildScript, False)
if len(stderr) > 0:
print(stdout)
print(stderr)
exit()
# delete .so file
soFile = "../Samples/UIWidgetsSamples_2019_4/Assets/Plugins/Android/libUIWidgets_d.so"
deleteCmd = ["rm", soFile]
runCmd(deleteCmd, False)
# link .so file
linkCmd = [
clang,
"-shared",
# "-Wl,--version-script="+FLUTTER_ROOT+"/flutter/shell/platform/android/android_exports.lst",
"-Wl,--fatal-warnings",
"-fPIC",
"-Wl,-z,noexecstack",
"-Wl,-z,now",
"-Wl,-z,relro",
"-Wl,-z,defs",
"--gcc-toolchain="+FLUTTER_ROOT + \
"/third_party/android_tools/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64",
"-Wl,--no-undefined",
"-Wl,--exclude-libs,ALL",
"-fuse-ld=lld",
"-Wl,--icf=all",
"--target=arm-linux-androideabi",
"-nostdlib++",
"-Wl,--warn-shared-textrel",
"-nostdlib",
"--sysroot="+FLUTTER_ROOT+"/third_party/android_tools/ndk/platforms/android-16/arch-arm",
"-L"+FLUTTER_ROOT + \
"/third_party/android_tools/ndk/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a",
"-o",
soFile,
"-Wl,--build-id=sha1",
"-g",
"-Wl,-soname=libUIWidgets_d.so",
"-Wl,--whole-archive",
]
linkCmd.extend(objs)
linkCmd.extend([
FLUTTER_ROOT+"/out/android_debug_unopt/obj/flutter/third_party/txt/libtxt_lib.a",
"-Wl,--no-whole-archive",
# lib for atexit
FLUTTER_ROOT+"/third_party/android_tools/ndk/platforms/android-16/arch-arm/usr/lib/crtbegin_so.o",
"-landroid",
"-lEGL",
"-lGLESv2",
"-landroid_support",
"-lunwind",
"-lgcc",
"-lc",
"-ldl",
"-lm",
"-llog",
FLUTTER_ROOT+"/third_party/android_tools/ndk/platforms/android-16/arch-arm/usr/lib/crtend_so.o",
])
runCmd(linkCmd, True)
正在加载...
取消
保存