public override bool Execute()
        {
//#if DEBUG
//            if (!Debugger.IsAttached)
//                Debugger.Launch();
//#endif
            LocateSolution();
            GetConfiguration();

            var crossTargetingProject = IsCrossTargeting();
            var platform       = TargetFrameworkIdentifier.GetTargetPlatform();
            var isPlatformHead = platform != Platform.Unsupported;
            var configuration  = ConfigHelper.GetConfig(BuildToolsConfigFilePath);

            // Only run these tasks for Android and iOS projects if they're not explicitly disabled
            EnableArtifactCopy        = !crossTargetingProject && IsEnabled(configuration?.ArtifactCopy) && isPlatformHead;
            EnableAutomaticVersioning = !crossTargetingProject && IsEnabled(configuration?.AutomaticVersioning) && isPlatformHead;
            EnableImageProcessing     = !crossTargetingProject && IsEnabled(configuration?.Images) && (platform == Platform.iOS || platform == Platform.Android);
            EnableTemplateManifests   = !crossTargetingProject && IsEnabled(configuration?.Manifests) && isPlatformHead;
            EnableReleaseNotes        = IsEnabled(configuration?.ReleaseNotes) && isPlatformHead;

            // Only run this if it's not disabled and there are SCSS files
            EnableScssToCss = IsEnabled(configuration?.Css) && Directory.EnumerateFiles(ProjectDir, "*.scss", SearchOption.AllDirectories).Any();

            // Only run this if it is there is a configuration that enables it... or there is are secrets with no config
            EnableSecrets = ShouldEnableSecrets(configuration);

            return(true);
        }
Example #2
0
        public DotNetCorePathFinder(TargetFrameworkIdentifier targetFramework, Version targetFrameworkVersion)
        {
            this.targetFrameworkVersion = targetFrameworkVersion;

            if (targetFramework == TargetFrameworkIdentifier.NETStandard)
            {
                // .NET Standard 2.1 is implemented by .NET Core 3.0 or higher
                if (targetFrameworkVersion.Major == 2 && targetFrameworkVersion.Minor == 1)
                {
                    this.targetFrameworkVersion = new Version(3, 0, 0);
                }
            }
        }
 public UniversalAssemblyResolver(string mainAssemblyFileName, bool throwOnError, string targetFramework)
 {
     this.targetFramework      = targetFramework ?? string.Empty;
     targetFrameworkIdentifier = ParseTargetFramework(this.targetFramework, out targetFrameworkVersion);
     this.mainAssemblyFileName = mainAssemblyFileName;
     this.baseDirectory        = Path.GetDirectoryName(mainAssemblyFileName);
     this.throwOnError         = throwOnError;
     if (string.IsNullOrWhiteSpace(this.baseDirectory))
     {
         this.baseDirectory = Environment.CurrentDirectory;
     }
     AddSearchDirectory(baseDirectory);
 }
Example #4
0
        public DotNetCorePathFinder(string parentAssemblyFileName, string targetFrameworkIdString, string preferredRuntimePack,
                                    TargetFrameworkIdentifier targetFramework, Version targetFrameworkVersion, ReferenceLoadInfo loadInfo = null)
            : this(targetFramework, targetFrameworkVersion, preferredRuntimePack)
        {
            string assemblyName = Path.GetFileNameWithoutExtension(parentAssemblyFileName);
            string basePath     = Path.GetDirectoryName(parentAssemblyFileName);

            searchPaths.Add(basePath);

            var depsJsonFileName = Path.Combine(basePath, $"{assemblyName}.deps.json");

            if (File.Exists(depsJsonFileName))
            {
                packages = LoadPackageInfos(depsJsonFileName, targetFrameworkIdString).ToArray();

                foreach (var path in LookupPaths)
                {
                    foreach (var p in packages)
                    {
                        foreach (var item in p.RuntimeComponents)
                        {
                            var itemPath = Path.GetDirectoryName(item);
                            var fullPath = Path.Combine(path, p.Name, p.Version, itemPath).ToLowerInvariant();
                            if (Directory.Exists(fullPath))
                            {
                                packageBasePaths.Add(fullPath);
                            }
                        }
                    }
                }
            }
            else
            {
                loadInfo?.AddMessage(assemblyName, MessageKind.Warning, $"{assemblyName}.deps.json could not be found!");
            }
        }
Example #5
0
        public DotNetCorePathFinder(string parentAssemblyFileName, string targetFrameworkIdString, TargetFrameworkIdentifier targetFramework, Version version, ReferenceLoadInfo loadInfo = null)
        {
            string assemblyName = Path.GetFileNameWithoutExtension(parentAssemblyFileName);
            string basePath     = Path.GetDirectoryName(parentAssemblyFileName);

            this.version = version;

            if (targetFramework == TargetFrameworkIdentifier.NETStandard)
            {
                // .NET Standard 2.1 is implemented by .NET Core 3.0 or higher
                if (version.Major == 2 && version.Minor == 1)
                {
                    this.version = new Version(3, 0, 0);
                }
            }

            var depsJsonFileName = Path.Combine(basePath, $"{assemblyName}.deps.json");

            if (!File.Exists(depsJsonFileName))
            {
                loadInfo?.AddMessage(assemblyName, MessageKind.Warning, $"{assemblyName}.deps.json could not be found!");
                return;
            }

            packages = LoadPackageInfos(depsJsonFileName, targetFrameworkIdString).ToArray();

            foreach (var path in LookupPaths)
            {
                foreach (var p in packages)
                {
                    foreach (var item in p.RuntimeComponents)
                    {
                        var itemPath = Path.GetDirectoryName(item);
                        var fullPath = Path.Combine(path, p.Name, p.Version, itemPath).ToLowerInvariant();
                        if (Directory.Exists(fullPath))
                        {
                            packageBasePaths.Add(fullPath);
                        }
                    }
                }
            }
        }