Пример #1
0
        public override void ConfigureAgde(Configuration conf, CommonTarget target)
        {
            base.ConfigureAgde(conf, target);

            conf.AddProject <ExeProject>(target);

            if (!_hasCopiedResources)
            {
                //copy top-level build gradle files to root dir
                AndroidUtil.DirectoryCopy(Path.Combine(conf.Solution.SharpmakeCsPath, @"..\gradle\root"), conf.SolutionPath);
                _hasCopiedResources = true;
            }
        }
Пример #2
0
        private void CopyAndroidResources(string projectPath)
        {
            _hasCopiedResources = true;

            string dstPath = Path.Combine(projectPath, @"src\main");

            if (!Directory.Exists(dstPath))
            {
                Directory.CreateDirectory(dstPath);
            }
            string srcManifestFile = Path.Combine(SharpmakeCsProjectPath, @"..\..\resources\AndroidManifest.xml");
            string dstManifestFile = Path.Combine(dstPath, "AndroidManifest.xml");

            Util.ForceCopy(srcManifestFile, dstManifestFile);
            UpdateManifestXML(dstManifestFile, "HelloAndroidAgde");

            // Copy module build gradle file to project folder
            string srcModulePath = Path.Combine(SharpmakeCsProjectPath, @"..\..\gradle\app");

            AndroidUtil.DirectoryCopy(srcModulePath, projectPath);
        }
        public static void SharpmakeMain(Sharpmake.Arguments arguments)
        {
            AndroidUtil.SetupDefaultSDKPaths();

            ConfigureRootDirectory();
            ConfigureAutoCleanup();

            FastBuildSettings.FastBuildWait             = true;
            FastBuildSettings.FastBuildSummary          = false;
            FastBuildSettings.FastBuildNoSummaryOnError = true;
            FastBuildSettings.FastBuildDistribution     = false;
            FastBuildSettings.FastBuildMonitor          = true;
            FastBuildSettings.FastBuildAllowDBMigration = true;

            // for the purpose of this sample, we'll reuse the FastBuild executables that live in the sharpmake source repo
            string sharpmakeFastBuildDir = Util.PathGetAbsolute(Globals.RootDirectory, @"..\..\..\tools\FastBuild");

            switch (Util.GetExecutingPlatform())
            {
            case Platform.linux:
                FastBuildSettings.FastBuildMakeCommand = Path.Combine(sharpmakeFastBuildDir, "Linux-x64", "fbuild");
                break;

            case Platform.mac:
                FastBuildSettings.FastBuildMakeCommand = Path.Combine(sharpmakeFastBuildDir, "OSX-x64", "FBuild");
                break;

            case Platform.win64:
            default:
                FastBuildSettings.FastBuildMakeCommand = Path.Combine(sharpmakeFastBuildDir, "Windows-x64", "FBuild.exe");
                break;
            }

            Bff.UnityResolver = new Bff.FragmentUnityResolver();

            foreach (Type solutionType in Assembly.GetExecutingAssembly().GetTypes().Where(t => !t.IsAbstract && t.IsSubclassOf(typeof(CommonSolution))))
            {
                arguments.Generate(solutionType);
            }
        }