Ejemplo n.º 1
0
 /// <summary>
 /// Parses the input, ensuring the class name is found
 /// </summary>
 public void VerifyFindClassname( string input, string expectedClassname )   {
     VjcTask vjcTask = new VjcTask();
     StringReader reader = new StringReader( input );
     CompilerBase.ResourceLinkage linkage = vjcTask.PerformSearchForResourceLinkage( reader );
     
     Assertion.AssertNotNull("no resourcelinkage found for " + input, linkage);
     string message = string.Format( "Failed to find expected class name {0}. Found {1} instead.", linkage.ClassName, expectedClassname ); 
     Assertion.Assert( message, (expectedClassname == linkage.ClassName ) );
 }
Ejemplo n.º 2
0
        private string GetManifestResourceNameJSharp(ConfigurationSettings configSetting, string dependentFile) {
            // defer to the resource management code in VjcTask
            VjcTask vjc = new VjcTask();
            vjc.Project = _solutionTask.Project;
            vjc.NamespaceManager = _solutionTask.NamespaceManager;
            vjc.OutputFile = new FileInfo(FileUtils.CombinePaths(configSetting.OutputDir.FullName,
                Project.ProjectSettings.OutputFileName));

            // set-up resource fileset
            ResourceFileSet resources = new ResourceFileSet();
            resources.Project = _solutionTask.Project;
            resources.NamespaceManager = _solutionTask.NamespaceManager;
            resources.Parent = vjc;
            resources.BaseDirectory = new DirectoryInfo(Path.GetDirectoryName(
                Project.ProjectPath));
            resources.Prefix = Project.ProjectSettings.RootNamespace;
            resources.DynamicPrefix = true;

            // bug #1042917: use logical location of resource file to determine
            // manifest resource name
            return vjc.GetManifestResourceName(resources, InputFile.FullName,
                LogicalFile.FullName, dependentFile);
        }