Exemplo n.º 1
0
        /// <summary>
        /// Creates an instance of a <see cref="BundleBuilder"/>.
        /// </summary>
        /// <param name="name">The name of the bundle to create.</param>
        /// <param name="bindPaths">Additional bind paths for building the bundle.</param>
        /// <param name="preprocessorVariables">Preprocessor variables for building the bundle.</param>
        /// <param name="extensions">Extensions for building the bundle.</param>
        /// <returns>A new <see cref="BundleBuilder"/> initialized with the given data.</returns>
        protected BundleBuilder CreateBundle(string name, Dictionary<string, string> bindPaths = null, Dictionary<string, string> preprocessorVariables = null, string[] extensions = null)
        {
            string testDataDirectory = Path.Combine(this.TestContext.TestDataDirectory, @"Integration\BurnIntegrationTests\BasicTests");
            BundleBuilder builder = new BundleBuilder(this.TestContext.TestName, name, testDataDirectory, this.TestArtifacts);

            if (null != bindPaths)
            {
                builder.BindPaths = bindPaths;
            }

            if (null != preprocessorVariables)
            {
                builder.PreprocessorVariables = preprocessorVariables;
            }

            builder.Extensions = extensions ?? WixTestBase.Extensions;

            return builder.Build();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Creates an instance of a <see cref="BundleBuilder"/>.
        /// </summary>
        /// <param name="name">The name of the bundle to create.</param>
        /// <param name="bindPaths">Additional bind paths for building the bundle.</param>
        /// <param name="preprocessorVariables">Preprocessor variables for building the bundle.</param>
        /// <param name="extensions">Extensions for building the bundle.</param>
        /// <returns>A new <see cref="BundleBuilder"/> initialized with the given data.</returns>
        protected BundleBuilder CreateBundle(string name, Dictionary <string, string> bindPaths = null, Dictionary <string, string> preprocessorVariables = null, string[] extensions = null)
        {
            string        testDataDirectory = Path.Combine(this.TestContext.TestDataDirectory, @"Integration\BurnIntegrationTests\BasicTests");
            BundleBuilder builder           = new BundleBuilder(this.TestContext.TestName, name, testDataDirectory, this.TestArtifacts);

            if (null != bindPaths)
            {
                builder.BindPaths = bindPaths;
            }

            if (null != preprocessorVariables)
            {
                builder.PreprocessorVariables = preprocessorVariables;
            }

            builder.Extensions = extensions ?? WixTestBase.Extensions;

            return(builder.Build());
        }
Exemplo n.º 3
0
    private void OnGUI()
    {
        //GUILayout.Label("this is a label");


        xSymbol         = (Texture2D)EditorGUILayout.ObjectField("X Symbol", xSymbol, typeof(Texture2D), false);
        oSymbol         = (Texture2D)EditorGUILayout.ObjectField("O Symbol", oSymbol, typeof(Texture2D), false);
        background      = (Texture2D)EditorGUILayout.ObjectField("Background", background, typeof(Texture2D), false);
        assetBundleName = EditorGUILayout.TextField("Asset name", assetBundleName);

        //EditorGUILayout.RectField
        if (GUILayout.Button("Build asset bundle"))
        {
            AssetImporter.GetAtPath(AssetDatabase.GetAssetPath(xSymbol)).assetBundleName    = assetBundleName;
            AssetImporter.GetAtPath(AssetDatabase.GetAssetPath(oSymbol)).assetBundleName    = assetBundleName;
            AssetImporter.GetAtPath(AssetDatabase.GetAssetPath(background)).assetBundleName = assetBundleName;

            BundleBuilder.Build();



            Debug.Log("save");
        }
    }
Exemplo n.º 4
0
        protected BundleBuilder CreateBundle(string name, Dictionary<string, string> bindPaths = null, Dictionary<string, string> preprocessorVariables = null, string[] extensions = null)
        {
            BundleBuilder builder = new BundleBuilder(this.TestContext.TestName, name, this.TestContext.TestDataDirectory, this.TestContext.TestArtifacts);

            if (null != bindPaths)
            {
                builder.BindPaths = bindPaths;
            }

            if (null != preprocessorVariables)
            {
                builder.PreprocessorVariables = preprocessorVariables;
            }

            builder.Extensions = null == extensions ? WixTestBase.Extensions : extensions;

            return builder.Build();
        }
Exemplo n.º 5
0
        public BackendResult Generate(Action <ICompiler> callback)
        {
            Progress(BuildStep.Generating);
            Backend.Configure();

            if (Environment.Options.TestOptions.HasValue)
            {
                Run(new TestSetupTransform(Pass, Environment.IsDefined("HEADLESS")));
            }

            if (Backend.BuildType == BuildType.Executable)
            {
                Data.ResolveMainClass(Pass, Environment);
            }

            Run(new ExtensionTransform(Pass));
            Run(new FixedArrayTransform(Pass));

            if (Backend.Has(FunctionOptions.ClosureConvert))
            {
                Run(new ClosureConversionTransform(Pass));
            }

            Run(_generators);
            BundleBuilder.Build();
            Data.CreateEntrypoint();
            Run(ConstantFolder);

            Run(new ControlFlowVerifier(Pass));

            if (Backend.Has(TypeOptions.CopyStructs))
            {
                Run(new StructCopyTransform(Pass));
            }

            if (Environment.Options.OptimizeLevel >= 1)
            {
                Run(new O1(Pass));
            }

            Run(new BackendTransform(Pass));
            Run(new MemberTransform(Pass));

            if (Backend.Has(TypeOptions.MakeUniqueNames))
            {
                Run(new NameTransform(Pass));
            }
            if (Backend.Has(FunctionOptions.MakeNativeCode))
            {
                Run(new NativeTransform(Pass));
            }
            if (Backend.Has(FunctionOptions.Analyze))
            {
                Run(new A1(Pass));
                Run(new A2(Pass));
            }

            Run(new IndirectionTransform(Pass));
            Run(new ExternTransform(Pass));

            UxlProcessor.CompileRequirements();
            ILStripper.Begin();
            Run(_transforms);
            TypeBuilder.BuildTypes();

            using (Log.StartProfiler(ILStripper))
                ILStripper.End();

            UxlProcessor.FlattenExtensions();
            Run(ILVerifier);

            if (Log.HasErrors)
            {
                return(null);
            }

            var buildProfiler = Log.StartProfiler(Backend.GetType());

            try
            {
                Backend.BeginBuild();
                return(Backend.Build());
            }
            finally
            {
                Backend.EndBuild();
                buildProfiler.Dispose();
                UxlProcessor.WriteTypedFiles();
                callback(this);
                Environment.ClearPropertyCache();
                UxlProcessor.WriteUntypedFiles();
                Wait();
                Backend.End();
                StoreCache();
            }
        }