Ejemplo n.º 1
0
        private static void ConfigureBridgeOptionsForProject(ref BridgeOptions bridgeOptions, ProjectExportConfig projectConfig, UnityPluginConfig pluginConfig)
        {
            bridgeOptions.ProjectProperties = new ProjectProperties();

            bridgeOptions.BridgeLocation = references["Bridge"]["Bridge.dll"];
            bridgeOptions.Lib            = build["Output"]["minigame-adaptor-project.dll"];
            bridgeOptions.ReferencesPath = references["Bridge"].FullPath;
            bridgeOptions.ProjectProperties.Configuration = configs["Text"]["bridge.json"].PathToAssets();

            bridgeOptions.Folder            = Path.GetFullPath(".");
            bridgeOptions.Sources           = ProjectExportUtil.GetProjectSources(projectConfig).FilesListToLine();
            bridgeOptions.ExcludeSubFolders = ProjectExportUtil.GetBridgeExcludes(projectConfig, pluginConfig).FilesListToLine();

            bridgeOptions.Rebuild         = true;
            bridgeOptions.Recursive       = true;
            bridgeOptions.Name            = "minigame-adaptor-project";
            bridgeOptions.OutputLocation  = bridgeOptions.Folder;
            bridgeOptions.DefaultFileName = Path.GetFileNameWithoutExtension(bridgeOptions.Lib);
            bridgeOptions.ProjectProperties.AssemblyName    = bridgeOptions.DefaultFileName;
            bridgeOptions.ProjectProperties.DefineConstants = projectConfig.defineMacros.Join(";");
        }
Ejemplo n.º 2
0
        private static Compilation BuildDLL(ProjectExportConfig config)
        {
            // var sources = config.project.AllSources().ToList();
            // var references = config.project.AllReferences().ToList();
            var sources  = ProjectExportUtil.GetProjectSourcesWithoutExcludes(config);
            var excludes = new List <string>();

            excludes.Add("**/*~/**/*.dll");
            excludes.Add("**/[Ee]ditor/**/*.dll");
            excludes.Add("**/script-export/**/*.dll");
            var references = ProjectExportUtil.GetProjectLibs(config, excludes);

            references.AddRange(UnityPluginUtil.GetUnityEngineLibs());
            // references.AddRange(DLLProc.SystemDLLPath());
            // references.AddRange(DLLProc.UnityEngineDLLPath());
            // references.AddRange(DLLProc.SystemDLLPath());
            Debug.Log("Building Assembly for sources[" + sources.Count + "], references[" + references.Count + "]");
            return(DLLProc.BuildDLL("WAGameUnityProject",
                                    sources,
                                    config.defineMacros,
                                    references, true));
        }