Exemplo n.º 1
0
        public FileIndexer()
        {
            DirectoryInfo mydir = new DirectoryInfo(@"../../../Nethereum.Worbooks.Tests");

            FileInfo[] f = mydir.GetFiles();
            foreach (FileInfo file in f)
            {
                if (file.Name.Contains("UnitTest"))
                {
                    Nugets.Add(new Nuget()
                    {
                        Path = file.DirectoryName
                    });
                    //for (int i = 0; i < Nugets.Count; i++)
                    //{
                    //    Nugets.Add(new Nuget() { Path = f[i].DirectoryName });
                    //}
                    System.Console.WriteLine("File Name: {0} Size: {1}", file.Name, file.DirectoryName);
                }
            }
            //for (int i = 0; i < Nugets.Count; i++)
            //{
            //    if (mydir.Name.Contains("UnitTest"))
            //    {
            //        Nugets.Add(new Nuget() { Path = f[i].DirectoryName });
            //        Console.WriteLine("File Name: {0} Size: {1}", f[1].Name, f[i].DirectoryName);
            //        Console.WriteLine(Nugets);
            //    }
            //}
            System.Console.ReadLine();
        }
Exemplo n.º 2
0
        public async Task AddPackage(string name, Action <string>?statusCallback = null)
        {
            if (Nugets == null)
            {
                throw new InvalidOperationException("Packages can be only added to the global references collection");
            }

            var duration = Stopwatch.StartNew();

            var pkg = await Nugets.Add(name, statusCallback);

            AddAssemblies(Nugets.Assemblies.ToArray());

            duration.Stop();
            PackageLoaded?.Invoke(this, new PackageLoadedEventArgs(pkg.Id, pkg.Version.ToNormalizedString(), duration.Elapsed));
        }
Exemplo n.º 3
0
        /// <summary>
        /// Adds the libraries from the given nuget package to the list of assemblies.
        /// If version is not provided. It automatically picks up the latest version.
        /// </summary>
        public async Task AddPackage(string name)
        {
            var duration = Stopwatch.StartNew();

            if (Nugets == null)
            {
                throw new InvalidOperationException("Packages can be only added to the global references collection");
            }

            var pkg = await Nugets.Add(name);

            Assemblies = Assemblies.Union(Nugets.Assemblies).ToImmutableArray();
            Reset();

            duration.Stop();
            PackageLoaded?.Invoke(this, new PackageLoadedEventArgs(pkg.Id, pkg.Version.ToNormalizedString(), duration.Elapsed));
        }
 public LibraryInfo Clone()
 {
     return(new LibraryInfo(Type, CompilerName, DependenciesVersion, RequireDependenciesLegacy, ReferencesLegacy, Nugets.Select(it => it.Clone()).ToList(), BuildType, Extension, SupportedBuilds)
     {
         CompileOption = CompileOption,
         Name = Name,
         Target = Target,
         Dependencies = Dependencies,
         WithActiveRecord = WithActiveRecord,
         WithHelperMethods = WithHelperMethods,
         WithManualJson = WithManualJson,
         UseUtc = UseUtc,
         MinimalSerialization = MinimalSerialization,
         NoPrepareExecute = NoPrepareExecute,
         MutableSnowflake = MutableSnowflake,
         Legacy = Legacy,
         Namespace = Namespace
     });
 }