private void ImportSourceFile(VirtualPath virtualPath)
        {
            VirtualPath fileName = this._virtualPath.Parent.Combine(virtualPath);

            this.AddSourceDependency(fileName);
            CompilationUtil.GetCompilerInfoFromVirtualPath(fileName);
            BuildResultCompiledAssembly vPathBuildResult = (BuildResultCompiledAssembly)BuildManager.GetVPathBuildResult(fileName);
            Assembly resultAssembly = vPathBuildResult.ResultAssembly;

            this.AddAssemblyDependency(resultAssembly);
        }
Example #2
0
        /*
         * Compile a source file into an assembly, and import it
         */
        private void ImportSourceFile(VirtualPath virtualPath)
        {
            // Get a full path to the source file
            VirtualPath baseVirtualDir  = _virtualPath.Parent;
            VirtualPath fullVirtualPath = baseVirtualDir.Combine(virtualPath);

            // Add the source file to the list of files we depend on
            AddSourceDependency(fullVirtualPath);

            //

            CompilationUtil.GetCompilerInfoFromVirtualPath(fullVirtualPath);

            // Compile it into an assembly

            BuildResultCompiledAssembly result = (BuildResultCompiledAssembly)BuildManager.GetVPathBuildResult(
                fullVirtualPath);
            Assembly a = result.ResultAssembly;

            // Add a dependency to the assembly
            AddAssemblyDependency(a);
        }