Exemplo n.º 1
0
        protected override string[] GenerateArguments()
        {
            var builder = new List <string>();

            if ((Assemblies != null) && (Assemblies.Length > 0))
            {
                foreach (var asm in Assemblies)
                {
                    builder.Add(ToolOptions.WcfProxyInputAssembly.AsArg());
                    builder.Add(asm.ItemSpec);
                }
            }

            if (GeneratedSourcePath != null)
            {
                builder.Add(ToolOptions.WcfProxyGeneratedSourcePath.AsArg());
                builder.Add(GeneratedSourcePath.ItemSpec);
            }

            if (ReferenceFolders != null)
            {
                foreach (var x in ReferenceFolders.Where(x => x != null))
                {
                    builder.Add(ToolOptions.ReferenceFolder.AsArg());
                    builder.Add(x.ItemSpec);
                }
            }

            builder.AddTarget();
            return(builder.ToArray());
        }
Exemplo n.º 2
0
        protected override string[] GenerateArguments()
        {
            if (null != ManifestResources)
            {
                // Check if there is more than 1 manifest file.
                if (ManifestResources.Length > 1)
                {
                    // Add a Build Error for each file, so the user can easily find each one.
                    foreach (ITaskItem item in ManifestResources)
                    {
                        Log.LogError("Error", "D42-0005", string.Empty, item.ItemSpec, 1, 1, 1, 1, "The project should only contain 1 manifest file.");
                    }

                    // Tell the base class that executing this task has failed.
                    return(null);
                }

                // There is only 1 manifest. Copy it to the output folder because we don't need to create one.
                if (1 == ManifestResources.Length)
                {
                    File.Copy(ManifestResources[0].ItemSpec, Path.Combine(DstDir.ItemSpec, "AndroidManifest.xml"), true);

                    // Tell the base class that executing this task has finished successful.
                    return(new string[0]);
                }
            }

            var builder = new List <string>();

            builder.Add(ToolOptions.CreateManifest.AsArg());

            if (!string.IsNullOrEmpty(PackageName))
            {
                builder.Add(ToolOptions.PackageName.AsArg());
                builder.Add(PackageName);
            }

            if (!string.IsNullOrEmpty(RootNamespace))
            {
                builder.Add(ToolOptions.RootNamespace.AsArg());
                builder.Add(RootNamespace);
            }

            if (Debuggable)
            {
                builder.Add(ToolOptions.DebugInfo.AsArg());
            }

            if (DstDir != null)
            {
                builder.Add(ToolOptions.OutputFolder.AsArg());
                builder.Add(DstDir.ItemSpec);
            }

            if (Assembly != null)
            {
                builder.Add(ToolOptions.InputAssembly.AsArg());
                builder.Add(Assembly.ItemSpec);
            }

            if (AppWidgetProviders != null)
            {
                foreach (var x in AppWidgetProviders)
                {
                    builder.Add(ToolOptions.AppWidgetProvider.AsArg());
                    builder.Add(x.ItemSpec);
                }
            }

            if (ReferenceFolders != null)
            {
                foreach (var x in ReferenceFolders.Where(x => x != null))
                {
                    builder.Add(ToolOptions.ReferenceFolder.AsArg());
                    builder.Add(x.ItemSpec);
                }
            }

            if (!string.IsNullOrEmpty(TargetSdkVersion))
            {
                builder.Add(ToolOptions.TargetSdkVersion.AsArg());
                builder.Add(TargetSdkVersion);
            }

            builder.AddTarget();
            return(builder.ToArray());
        }