Example #1
0
        public GruntTask FromYaml(string yaml)
        {
            IDeserializer       deserializer = new DeserializerBuilder().Build();
            SerializedGruntTask task         = deserializer.Deserialize <SerializedGruntTask>(yaml);

            return(this.FromSerializedGruntTask(task));
        }
Example #2
0
 internal GruntTask FromSerializedGruntTask(SerializedGruntTask task)
 {
     this.Name        = task.Name;
     this.Author      = new GruntTaskAuthor().FromSerializedGruntTaskAuthor(task.Author);
     this.Aliases     = task.Aliases;
     this.Description = task.Description;
     this.Help        = task.Help;
     this.Language    = task.Language;
     this.CompatibleDotNetVersions = task.CompatibleDotNetVersions;
     this.Code          = task.Code;
     this.Compiled      = false;
     this.TaskingType   = task.TaskingType;
     this.UnsafeCompile = task.UnsafeCompile;
     this.TokenTask     = task.TokenTask;
     this.Options       = task.Options.Select(O => new GruntTaskOption().FromSerializedGruntTaskOption(O)).ToList();
     this.Options.ForEach(O => O.GruntTaskId = this.Id);
     task.ReferenceSourceLibraries.ForEach(RSL => this.Add(new ReferenceSourceLibrary().FromSerializedReferenceSourceLibrary(RSL)));
     task.ReferenceAssemblies.ForEach(RA => this.Add(new ReferenceAssembly().FromSerializedReferenceAssembly(RA)));
     task.EmbeddedResources.ForEach(ER => this.Add(new EmbeddedResource().FromSerializedEmbeddedResource(ER)));
     return(this);
 }
Example #3
0
        public GruntTask FromJson(string json)
        {
            SerializedGruntTask task = JsonConvert.DeserializeObject <SerializedGruntTask>(json);

            return(this.FromSerializedGruntTask(task));
        }