コード例 #1
0
 public static OptionalSdkConfigOptions Optionalize(this Optional <SdkConfigOptions> sdkConfigOptions)
 {
     if (sdkConfigOptions.HasValue)
     {
         var someConfig = sdkConfigOptions.Value;
         return(new OptionalSdkConfigOptions(
                    androidSdkDirectory: AbsoluteDirectoryPath.TryParse(someConfig.AndroidSdkDirectory),
                    androidNdkDirectory: AbsoluteDirectoryPath.TryParse(someConfig.AndroidNdkDirectory),
                    javaJdkDirectory: AbsoluteDirectoryPath.TryParse(someConfig.JavaJdkDirectory),
                    androidSdkBuildToolsVersion: someConfig.AndroidSdkBuildToolsVersion.ToOptional(),
                    cmake: AbsoluteDirectoryPath.TryParse(someConfig.CMake),
                    haveAllSdkPackages: someConfig.HaveAllSdkPackages
                    ));
     }
     else
     {
         return(new OptionalSdkConfigOptions(
                    Optional.None(),
                    Optional.None(),
                    Optional.None(),
                    Optional.None(),
                    Optional.None(),
                    false));
     }
 }
コード例 #2
0
ファイル: CreateProject.cs プロジェクト: yongaru/fuse-studio
        public static IValidationResult <AbsoluteDirectoryPath> ValidateExistingDirectory(string nativePath)
        {
            var parsed = AbsoluteDirectoryPath.TryParse(nativePath);

            if (parsed.HasValue && !Directory.Exists(nativePath))
            {
                return(Optional.None <AbsoluteDirectoryPath>().AsValidationResult("No such directory"));
            }
            return(parsed.AsValidationResult("Invalid path"));
        }
コード例 #3
0
        static AbsoluteFilePath FindMonoExe(AbsoluteDirectoryPath fuseRoot)
        {
            var monoRoot = File.ReadAllText((fuseRoot / new FileName(".mono_root")).NativePath);
            var monoPath = RelativeDirectoryPath.TryParse(monoRoot)
                           .Select(monoRelative => fuseRoot / monoRelative)
                           .Or(AbsoluteDirectoryPath.TryParse(monoRoot))
                           .OrThrow(new InvalidPath(monoRoot, new Exception("Invalid mono root path.")));

            return(monoPath / new DirectoryName("bin") / new FileName("mono"));
        }
コード例 #4
0
 public static ProjectSnapshot CreateSnapshot(Project project, AbsoluteDirectoryPath root)
 {
     project.InvalidateItems();
     return(new ProjectSnapshot(
                name: project.Name,
                uxFiles:
                project.UXFiles
                .Select(f => root / RelativeFilePath.Parse(f.UnixPath))
                .ToImmutableHashSet(),
                bundleFiles:
                project.BundleFiles
                .Select(f => root / RelativeFilePath.Parse(f.UnixPath))
                .ToImmutableHashSet(),
                fuseJsFiles:
                project.FuseJSFiles
                .Select(f => root / RelativeFilePath.Parse(f.UnixPath))
                .ToImmutableHashSet(),
                buildOutputDirectory:
                AbsoluteDirectoryPath.TryParse(project.BuildDirectory).Or(root / new DirectoryName("build")),
                packageReferences: project.PackageReferences.ToImmutableHashSet(),
                projectReferences: project.ProjectReferences.ToImmutableHashSet()
                ));
 }
コード例 #5
0
ファイル: Dialog.cs プロジェクト: yongaru/fuse-studio
 public DialogPathResult(string rawPath)
 {
     _rawPath = rawPath;
     Path     = AbsoluteDirectoryPath.TryParse(rawPath).Select(p => (IAbsolutePath)p)
                .Or(AbsoluteFilePath.TryParse(rawPath).Select(p => (IAbsolutePath)p));
 }