Example #1
0
        public void AnalyzeAndWeaveExternals()
        {
            NameValueCollection config = new NameValueCollection();

            config.Add("OutputImagePath", Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Woven"));
            config.Add("ShouldSignAssembly", "false");
            config.Add("OutputImageSNK", "");
            config.Add("RepositoryFilename", CreateFullPath("starlight.yap"));
            config.Add("InstallFolder", installationFolder);

            Directory.CreateDirectory(config["OutputImagePath"]);

            CecilILAnalyzer analyzer = new CecilILAnalyzer();

            analyzer.Initialize(FilenameSource, config);

            // Run the analyzer
            IList <TypeElement> ret = analyzer.ExtractTypeElements();

            analyzer.ProcessUnresolvedTypes();
            analyzer.Close();

            // Change the types
            Composestar.Repository.RepositoryAccess repository = new Composestar.Repository.RepositoryAccess(CreateFullPath("starlight.yap"));

            TypeElement te = null;
            External    e;

            #region Add external '??' (String) to ??
            //te = repository.GetTypeElement("ConsoleTestTarget.HelloWorld");
            //i = new Internal();
            //i.ParentTypeId = te.Id;
            //i.Name = "HelloWorldStringInternal";
            //i.NameSpace = "ConsoleTestTarget.HelloWorld";
            //i.Type = "System.String, mscorlib";
            //Composestar.Repository.DataStoreContainer.Instance.StoreObject(i);
            #endregion


            // Run the weaver
            CecilILWeaver weaver = new CecilILWeaver();
            weaver.Initialize(FilenameSource, config);
            weaver.DoWeave(); // Place debugger here or perform Asserts
            weaver.Close();
        }
Example #2
0
        public void CanCreateWeaverThroughDIHelper()
        {
            CecilILWeaver weaver = DIHelper.CreateObject <CecilILWeaver>(svcContainer);

            Assert.IsNotNull(weaver);
        }