private void OnGUI()
        {
            using (new EditorGUILayout.VerticalScope(GUI.skin.box))
            {
                _archType = (ArchitectureType)EditorGUILayout.EnumPopup("Architecture Type", _archType);
            }

            using (new EditorGUILayout.VerticalScope(GUI.skin.box))
            {
                _baseScriptPath = EditorGUILayout.TextField("Base script path", _baseScriptPath);
                _nameSpaceName  = EditorGUILayout.TextField("Namespace name", _nameSpaceName);

                if (GUILayout.Button("Build Project"))
                {
                    GenerateAssemblyDefinitions();
                }
            }

            GUILayout.Space(10);

            using (new EditorGUILayout.VerticalScope(GUI.skin.box))
            {
                EditorGUI.BeginDisabledGroup(_archType == ArchitectureType.Pattern2);

                _className = EditorGUILayout.TextField("Class Name", _className);

                if (GUILayout.Button("Generate Codes"))
                {
                    GenerateCodes();
                }

                EditorGUI.EndDisabledGroup();
            }
        }
コード例 #2
0
 public TargetType(
     PlatformType platform,
     ArchitectureType architecture)
 {
     this.Platform     = platform;
     this.Architecture = architecture;
 }
 private void OnEnable()
 {
     _archType       = (ArchitectureType)Enum.ToObject(typeof(ArchitectureType), EditorPrefs.GetInt("CAGEN_ARCHTYPE", 0));
     _baseScriptPath = EditorPrefs.GetString("CAGEN_BASEPATH", "Assets/Scripts");
     _nameSpaceName  = EditorPrefs.GetString("CAGEN_NAMESPACE", "ProjectBlue.ProductName");
     _className      = EditorPrefs.GetString("CAGEN_CLASSNAME", "SampleClass");
 }
コード例 #4
0
 protected BaseToolchain(
     Profile profile,
     ArchitectureType architectureType)
 {
     this.m_Profile        = profile;
     this.ArchitectureType = architectureType;
 }
コード例 #5
0
 public GradleProjectGenerator(String SolutionName, Project Project, List <ProjectReference> ProjectReferences, PathString InputDirectory, PathString OutputDirectory, PathString SolutionOutputDirectory, String BuildGradleTemplateText, OperatingSystemType HostOperatingSystem, ArchitectureType HostArchitecture, OperatingSystemType TargetOperatingSystem, ArchitectureType?TargetArchitecture, ToolchainType Toolchain, CompilerType Compiler, CLibraryType CLibrary, CLibraryForm CLibraryForm, CppLibraryType CppLibrary, CppLibraryForm CppLibraryForm, ConfigurationType?ConfigurationType, PathString AndroidNdk)
 {
     this.SolutionName            = SolutionName;
     this.ProjectName             = Project.Name.Split(':').First();
     this.Project                 = Project;
     this.ProjectReferences       = ProjectReferences;
     this.InputDirectory          = InputDirectory.FullPath;
     this.OutputDirectory         = OutputDirectory.FullPath;
     this.SolutionOutputDirectory = SolutionOutputDirectory.FullPath;
     this.BuildGradleTemplateText = BuildGradleTemplateText;
     this.HostOperatingSystem     = HostOperatingSystem;
     this.HostArchitecture        = HostArchitecture;
     this.TargetOperatingSystem   = TargetOperatingSystem;
     this.TargetArchitecture      = TargetArchitecture;
     if (!TargetArchitecture.HasValue)
     {
         throw new NotSupportedException("ArchitectureTypeIsNull");
     }
     this.Toolchain         = Toolchain;
     this.Compiler          = Compiler;
     this.CLibrary          = CLibrary;
     this.CLibraryForm      = CLibraryForm;
     this.CppLibrary        = CppLibrary;
     this.CppLibraryForm    = CppLibraryForm;
     this.ConfigurationType = ConfigurationType;
     this.AndroidNdk        = AndroidNdk;
 }
コード例 #6
0
 protected BasePlatform(
     Profile profile,
     ArchitectureType architectureType)
 {
     this.ArchitectureType = architectureType;
     this.m_Profile        = profile;
 }
コード例 #7
0
 protected BaseWindowsPlatform(
     Profile profile,
     ArchitectureType architectureType)
     : base(
         profile,
         architectureType)
 {
 }
コード例 #8
0
 public MockToolchain(
     Profile profile,
     ArchitectureType architectureType)
     : base(
         profile,
         architectureType)
 {
 }
コード例 #9
0
 public MockPlatform(
     Profile profile,
     ArchitectureType architectureType)
     : base(
         profile,
         architectureType)
 {
 }
コード例 #10
0
 public LinuxPlatformFactory(
     ArchitectureType architectureType,
     ToolchainType toolchainType)
     : base(
         PlatformType.Linux,
         architectureType,
         toolchainType)
 {
 }
コード例 #11
0
 public UniversalWindowsPlatformFactory(
     ArchitectureType architectureType,
     ToolchainType toolchainType)
     : base(
         PlatformType.UniversalWindows,
         architectureType,
         toolchainType)
 {
 }
コード例 #12
0
 protected BasePlatformFactory(
     PlatformType platformType,
     ArchitectureType architectureType,
     ToolchainType toolchainType)
 {
     this.PlatformType     = platformType;
     this.ArchitectureType = architectureType;
     this.ToolchainType    = toolchainType;
 }
コード例 #13
0
 public AndroidPlatformFactory(
     ArchitectureType architectureType,
     ToolchainType toolchainType)
     : base(
         PlatformType.Android,
         architectureType,
         toolchainType)
 {
 }
コード例 #14
0
 public AndroidPlatform(
     Profile profile,
     ArchitectureType architectureType)
     : base(
         profile,
         architectureType)
 {
     this.m_Settings = profile.GetSection <AndroidPlatformSettings>();
 }
コード例 #15
0
ファイル: SlnGenerator.cs プロジェクト: IanusInferus/typemake
 public SlnGenerator(String SolutionName, String SolutionId, List <ProjectReference> ProjectReferences, PathString OutputDirectory, String SlnTemplateText, OperatingSystemType TargetOperatingSystem, ArchitectureType TargetArchitecture)
 {
     this.SolutionName          = SolutionName;
     this.SolutionId            = SolutionId;
     this.ProjectReferences     = ProjectReferences;
     this.OutputDirectory       = OutputDirectory.FullPath;
     this.TargetOperatingSystem = TargetOperatingSystem;
     this.TargetArchitecture    = TargetArchitecture;
     this.SlnTemplateText       = SlnTemplateText;
 }
コード例 #16
0
        public static bool Is64Bit(this ArchitectureType self)
        {
            switch (self)
            {
            case ArchitectureType.X64:
            case ArchitectureType.ARM64:
                return(true);
            }

            throw new ArgumentOutOfRangeException(nameof(self));
        }
コード例 #17
0
 public static String GetTargetTripletString(ArchitectureType Architecture)
 {
     if (Architecture == ArchitectureType.armv7a)
     {
         return("arm-linux-androideabi");
     }
     else
     {
         return(GetNdkArchitectureString(Architecture) + "-linux-android");
     }
 }
コード例 #18
0
        public MsvcToolchain(
            Profile profile,
            ArchitectureType architectureType)
            : base(
                profile,
                architectureType)
        {
            this.m_Settings = profile.GetSection <MsvcToolchainSettings>();

            var vsInstances = VisualStudioToolchainProvider.Instances;

            var vsInstance = vsInstances.First(x => x.Toolkit == this.m_Settings.Toolkit);

            var architectureMnemonic = MapArchitectureType(this.ArchitectureType);

            var root = Path.Combine(vsInstance.Location, "VC", "Tools", "MSVC", vsInstance.Toolset);

            this.RootPath = Path.Combine(root, "bin", HostPathPrefix, architectureMnemonic);

            this.CompilerExecutable = Path.Combine(this.RootPath, "cl.exe");

            this.CompilerExtraFiles = new[]
            {
                Path.Combine(this.RootPath, "1033", "clui.dll"),
                Path.Combine(this.RootPath, "1033", "mspft140ui.dll"),
                Path.Combine(this.RootPath, "atlprov.dll"),
                Path.Combine(this.RootPath, "c1.dll"),
                Path.Combine(this.RootPath, "c1xx.dll"),
                Path.Combine(this.RootPath, "c2.dll"),
                Path.Combine(this.RootPath, "msobj140.dll"),
                Path.Combine(this.RootPath, "mspdb140.dll"),
                Path.Combine(this.RootPath, "mspdbcore.dll"),
                Path.Combine(this.RootPath, "mspdbsrv.exe"),
                Path.Combine(this.RootPath, "mspft140.dll"),
                Path.Combine(this.RootPath, "msvcp140.dll"),
                Path.Combine(this.RootPath, "tbbmalloc.dll"),
                Path.Combine(this.RootPath, "vcruntime140.dll"),
            };

            this.LinkerExecutable    = Path.Combine(this.RootPath, "link.exe");
            this.LibrarianExecutable = Path.Combine(this.RootPath, "lib.exe");

            this.IncludePaths = new[]
            {
                Path.Combine(vsInstance.Location, "VC", "Tools", "MSVC", vsInstance.Toolset, "include"),
                Path.Combine(vsInstance.Location, "VC", "Tools", "MSVC", vsInstance.Toolset, "atlmfc", "include"),
                Path.Combine(vsInstance.Location, "VC", "Auxiliary", "VS", "include"),
            };

            this.LibraryPaths = new[]
            {
                Path.Combine(vsInstance.Location, "VC", "Tools", "MSVC", vsInstance.Toolset, "lib", architectureMnemonic),
            };
        }
コード例 #19
0
ファイル: AssemblerFactory.cs プロジェクト: samshine/Squalr
        /// <summary>
        /// Gets an assembler based on the system architecture.
        /// </summary>
        /// <param name="architectureType">The system architecture.</param>
        /// <returns>An object implementing IAssembler based on the system architecture.</returns>
        public static IAssembler GetAssembler(ArchitectureType architectureType)
        {
            switch (architectureType)
            {
            case ArchitectureType.x86_64:
                return(new Fasm32Assembler());

            default:
                throw new Exception("Assembler not supported for specified architecture");
            }
        }
コード例 #20
0
 public ConfigurationContext(
     PlatformType platform,
     ArchitectureType architecture,
     BuildType build,
     ConfigurationType configuration)
 {
     this.Platform      = platform;
     this.Architecture  = architecture;
     this.Build         = build;
     this.Configuration = configuration;
 }
コード例 #21
0
        public UniversalWindowsPlatform(
            Profile profile,
            ArchitectureType architectureType)
            : base(
                profile,
                architectureType)
        {
            this.m_Settings = profile.GetSection <UniversalWindowsPlatformSettings>();
            var version = this.m_Settings.WindowsSdkVersion;

            this.InitializeBasePaths(version);
        }
コード例 #22
0
        internal static string ToSerializedValue(this ArchitectureType value)
        {
            switch (value)
            {
            case ArchitectureType.Amd64:
                return("Amd64");

            case ArchitectureType.Arm32v7:
                return("Arm32v7");
            }
            return(null);
        }
コード例 #23
0
 public AbiMapping(
     ArchitectureType architecture,
     string toolchain,
     string platform,
     int bitness,
     string libDirectory)
 {
     this.Architecture = architecture;
     this.Toolchain    = toolchain;
     this.Platform     = platform;
     this.Bitness      = bitness;
     this.LibDirectory = libDirectory;
 }
コード例 #24
0
        /// <summary>
        /// Get a human readable version of the requirement
        /// </summary>
        /// <returns></returns>
        public string GetDescription()
        {
            VersionType      versionType      = GetVersionType();
            ServicePackType  servicePackType  = GetServicePackType();
            ProductType      productType      = GetProductType();
            ArchitectureType architectureType = GetArchitectureType();
            IncludeType      includeType      = GetIncludeType();
            string           format           = GetDescriptionFormat(versionType, servicePackType, productType, architectureType, includeType);
            string           version          = GetVersionString();
            string           servicePack      = GetServicePackVersionString();

            return(string.Format(format, NamedVersion, version, servicePack));
        }
コード例 #25
0
        protected static string MapArchitectureType(ArchitectureType architectureType)
        {
            switch (architectureType)
            {
            case ArchitectureType.ARM64:
                return("arm64");

            case ArchitectureType.X64:
                return("x64");
            }

            throw new ArgumentOutOfRangeException(nameof(architectureType));
        }
コード例 #26
0
 public TargetTuple(
     PlatformType platformType,
     ArchitectureType architectureType,
     ToolchainType toolchainType,
     ConfigurationType configurationType,
     ConfigurationFlavour configurationFlavour)
 {
     this.PlatformType         = platformType;
     this.ArchitectureType     = architectureType;
     this.ToolchainType        = toolchainType;
     this.ConfigurationType    = configurationType;
     this.ConfigurationFlavour = configurationFlavour;
 }
コード例 #27
0
        /// <summary>
        /// Gets an object for assembling and disassembling instructions on the current platform.
        /// </summary>
        /// <returns>Returns an object for assembling and disassembling instructions based on the system architecture.</returns>
        public static IArchitecture GetArchitecture()
        {
            // For now, x86/64 is all that is supported. If this changes, we will need to determine the architecture here
            ArchitectureType architectureType = ArchitectureType.x86_64;

            switch (architectureType)
            {
            case ArchitectureType.x86_64:
                return(new Architecture86_64());

            default:
                throw new Exception("Unsupported Architecture Specified");
            }
        }
コード例 #28
0
    // Use this for initialization
    public static IEnumerator Generate(System.Random rand)
    {
        ArchitectureFactory architectureFactory = new ArchitectureFactory();

        Architecture.direction dir;

        foreach (Room room in Map.roomObjs)
        {
            if (room.roomType == roomType.common)
            {
                yield return(new WaitForSecondsRealtime(0.25f));

                for (int i = 0; i < 3; i++)
                {
                    ArchitectureType type = (ArchitectureType)rand.Next(0, 4);

                    Architecture arch = architectureFactory.CreateArchitecture(type);
                    arch.randomGen = rand;

                    dir = arch.GetRandom();

                    arch.Create(room, dir);
                }

                //int createPool = Random.Range(0, 6);//20%

                //if (createPool == 0)
                //{
                //    Pools pool = ScriptableObject.CreateInstance("Pools") as Pools;

                //    dir = pool.GetRandom();

                //    pool.Create(room, dir);
                //}

                int createCuts = rand.Next(0, 2);//50%
                if (createCuts == 0)
                {
                    Cuts cuts = new Cuts();
                    cuts.randomGen = rand;

                    dir = cuts.GetRandom();

                    cuts.Create(room, dir);
                }
            }
        }
        yield return(0);
    }
コード例 #29
0
        public LinuxPlatform(
            Profile profile,
            ArchitectureType architectureType)
            : base(
                profile,
                architectureType)
        {
            this.m_Settings = profile.GetSection <LinuxPlatformSettings>();

            // Default include paths
            this.IncludePaths = new string[] { };

            // Default library paths
            this.LibraryPaths = new string[] { };
        }
コード例 #30
0
        public static bool Is64Bit(this ArchitectureType value)
        {
            switch (value)
            {
            case ArchitectureType.X64:
            case ArchitectureType.ARMv8:
            case ArchitectureType.PPC64:
                return(true);

            case ArchitectureType.X86:
            case ArchitectureType.ARMv7:
                return(false);
            }

            throw new Exception($@"Unknown ArchitectureType {value}");
        }
コード例 #31
0
 public static String ProgramFolder(ArchitectureType type, String pattern)
 {
     String path = (type == ArchitectureType.x86) ? ProgramFilesx86 : ProgramFilesx64;
     return Directory.GetDirectories(path, pattern).FirstOrDefault();
 }
コード例 #32
0
 /// <summary>
 /// Locates the appropriate format string for the requirement type
 /// </summary>
 /// <param name="versionType"></param>
 /// <param name="spType"></param>
 /// <param name="productType"></param>
 /// <param name="architectureType"></param>
 /// <param name="includeType"></param>
 /// <returns></returns>
 private string GetDescriptionFormat(VersionType versionType, ServicePackType spType, ProductType productType, ArchitectureType architectureType, IncludeType includeType)
 {
     return DescriptionFormats[(int)versionType, (int)spType, (int)productType, (int)architectureType, (int)includeType];
 }