Esempio n. 1
0
        public NetStandardXamarinClassLibraryProject(string assemblyName, NetStandardPlatform targetFrameworkVersion, NugetPackage xamarinPackage, string rootNamespace = "") :
            base(assemblyName, targetFrameworkVersion, rootNamespace)
        {
            SupportedBuildConfigurations.Add(new SupportedBuildConfiguration("Ad-Hoc", "Any CPU"));
            SupportedBuildConfigurations.Add(new SupportedBuildConfiguration("Ad-Hoc", "iPhone"));
            SupportedBuildConfigurations.Add(new SupportedBuildConfiguration("Ad-Hoc", "iPhoneSimulator"));
            SupportedBuildConfigurations.Add(new SupportedBuildConfiguration("AppStore", "Any CPU"));
            SupportedBuildConfigurations.Add(new SupportedBuildConfiguration("AppStore", "iPhone"));
            SupportedBuildConfigurations.Add(new SupportedBuildConfiguration("AppStore", "iPhoneSimulator"));
            SupportedBuildConfigurations.Add(new SupportedBuildConfiguration("Debug", "iPhone"));
            SupportedBuildConfigurations.Add(new SupportedBuildConfiguration("Debug", "iPhoneSimulator"));
            SupportedBuildConfigurations.Add(new SupportedBuildConfiguration("Release", "iPhone"));
            SupportedBuildConfigurations.Add(new SupportedBuildConfiguration("Release", "iPhoneSimulator"));

            WithNugetPackage(xamarinPackage);

            AddFileToFolder(new DefaultAppXamlFile(RootNamespace));
            AddFileToFolder(new DefaultMainPageXamlFile(RootNamespace));
        }
        public static SolutionWizard With_NetStandardXamarinClassLibrary(this SolutionWizard wizard, string assemblyName, NugetPackage xamarinFormsPkg, NetStandardPlatform targetFrameworkVersion)
        {
            Project newProj = new NetStandardXamarinClassLibraryProject(assemblyName, targetFrameworkVersion, xamarinFormsPkg);

            wizard.WithProject(newProj);
            return(wizard);
        }
Esempio n. 3
0
        private static string TestConsoleAppWithNetStandardClassLibrarySolution()
        {
            NetStandardPlatform netStandardPlatform = NetStandardPlatform.v1_6;

            Project classLibProject = new NetStandardClassLibraryProject("NetStandardClassLibrary", netStandardPlatform)
                                      .WithNugetPackage(Core.References.Nuget.Newtonsoft_Json__11_0_2);

            classLibProject.AddFileToFolder(new ProjectFile("HelloWorld.cs", true, false, CreateHelloWorldClassFile(classLibProject.RootNamespace).ToString()));
            classLibProject.AddFileToFolder(new ProjectFile("Test.txt", false, true, "Testing a simple text file creation."));

            Project netFrameworkConsoleAppProject = new NetFrameworkConsoleApplicationCsProj("NetFrameworkConsoleApp", NetImplementationSupport.GetMinCompatibleWith(netStandardPlatform).NetFramework)
                                                    .WithProjectReference(new ProjectReference(classLibProject, new RelativePathBuilder().AppendPath(RelativePath.Up_Directory).ToString()))
                                                    .WithNugetPackage(Core.References.Nuget.Newtonsoft_Json__11_0_2);

            //netFrameworkConsoleAppProject.AddFileToFolder(new AppConfigFile(netFrameworkConsoleAppProject.TargetFrameworkVersion));
            netFrameworkConsoleAppProject.AddFileToFolder(new ProjectFile(
                                                              new SGFile("Program.cs")
            {
                AssemblyReferences =
                {
                    new SGAssemblyReference("System"),
                    new SGAssemblyReference("System.Collections.Generic"),
                    new SGAssemblyReference("System.Linq"),
                    new SGAssemblyReference("System.Text"),
                    new SGAssemblyReference("System.Threading.Tasks"),
                    new SGAssemblyReference(classLibProject)
                },
                Namespaces =
                {
                    new SGNamespace(netFrameworkConsoleAppProject.RootNamespace)
                    {
                        Classes =
                        {
                            new SGClass("Program",                                                                    SGAccessibilityLevel.None)
                            {
                                Methods =
                                {
                                    new SGMethod(new SGMethodSignature(accessibilityLevel: SGAccessibilityLevel.None, methodName: "Main", returnType: "void", isStatic: true)
                                    {
                                        Arguments =
                                        {
                                            new SGArgument("string[]",                                                "args")
                                        }
                                    })
                                    {
                                        Lines =
                                        {
                                            $"Console.WriteLine(HelloWorld.Greeting);",
                                            "",
                                            "Console.ReadLine();"
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }));

            return(new Solution("TestNetStandardSolution")
                   .WithProject(classLibProject)
                   .WithProject(netFrameworkConsoleAppProject)
                   .GenerateSolutionFiles(@"C:\"));
        }
Esempio n. 4
0
 public NetStandardProject(string assemblyName, string outputType, NetStandardPlatform targetFrameworkVersion, string rootNamespace = "") :
     this(assemblyName, Guid.NewGuid(), outputType, targetFrameworkVersion, rootNamespace)
 {
 }
Esempio n. 5
0
 public NetStandardProject(string assemblyName, Guid assemblyGuid, string outputType, NetStandardPlatform targetFrameworkVersion, string rootNamespace = "") :
     base(assemblyName, assemblyGuid, outputType, targetFrameworkVersion, rootNamespace)
 {
 }
 public NetStandardClassLibraryProject(string assemblyName, NetStandardPlatform targetFrameworkVersion, string rootNamespace = "") :
     base(assemblyName, "Library", targetFrameworkVersion, rootNamespace)
 {
     SupportedBuildConfigurations.Add(new SupportedBuildConfiguration("Debug", "Any CPU"));
     SupportedBuildConfigurations.Add(new SupportedBuildConfiguration("Release", "Any CPU"));
 }
Esempio n. 7
0
        public static SolutionWizard With_NetStandardClassLibrary(this SolutionWizard wizard, string assemblyName, NetStandardPlatform targetFrameworkVersion)
        {
            Project newProj = new NetStandardClassLibraryProject(assemblyName, targetFrameworkVersion);

            newProj.AddFileToFolder(new ProjectFile(SolutionWizard.CreateEmpty_NetFramework_ClassFile(assemblyName)));

            wizard.WithProject(newProj);

            return(wizard);
        }