Exemplo n.º 1
0
 private void createJarStubFiles()
 {
     O2Thread.mtaThread(
         () =>
     {
         // reset progress bar values
         this.invokeOnThread(() =>
         {
             progressBarForJarStubCreation.Maximum = dotNetAssembliesToConvert.loadedFiles.Count;
             progressBarForJarStubCreation.Value   = 0;
             btCreateJarStubFiles.Enabled          = false;
         });
         // process all files in dotNetAssembliesToConvert
         foreach (var fileToProcess in dotNetAssembliesToConvert.loadedFiles)
         {
             var jarStubFile = JavaCompile.createJarStubForDotNetDll(fileToProcess, IKVMConfig.jarStubsCacheDir);
             if (!File.Exists(jarStubFile))
             {
                 DI.log.error("Jar stub file not created for :{0}", jarStubFile);
             }
             this.invokeOnThread(() => progressBarForJarStubCreation.Value++);
         }
         deleteEmptyJarStubs();
         this.invokeOnThread(() => btCreateJarStubFiles.Enabled = true);
     });
 }
Exemplo n.º 2
0
        public void _test_createJarStubForAllO2Assemblies()
        {
            var o2Timer      = new O2Timer("created Jar Stubs for all O2Assemblies").start();
            var o2Assemblies = CompileEngine.getListOfO2AssembliesInExecutionDir();

            foreach (var o2Assembly in o2Assemblies)
            {
                var jarStubFile = JavaCompile.createJarStubForDotNetDll(o2Assembly, IKVMConfig.jarStubsCacheDir);
                Assert.That(File.Exists(jarStubFile), "jarStubFile didn't exist: {0}", jarStubFile);
            }
            DI.log.info("\n...all done\n");
            o2Timer.stop();
        }
Exemplo n.º 3
0
        public void _test_createJarStubForDotNetDll()
        {
            var targetDll = Path.Combine(DI.config.CurrentExecutableDirectory, DI.config.O2KernelAssemblyName);

            Assert.That(File.Exists(targetDll));
            //var jarStubFile = JavaCompile.createJarStubForDotNetDll(targetDll,IKVMConfig.jarStubsCacheDir);
            //Assert.That(File.Exists(jarStubFile), "jarStubFile didn't exist: {0}", jarStubFile);
            var dotNetV2Dir = @"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727";
            var dotNetV3Dir = @"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0";
            var msCorLibDll = Path.Combine(dotNetV2Dir, "mscorlib.dll");

            Assert.That(File.Exists(msCorLibDll), "msCorLibDll didn't exist: {0}", msCorLibDll);
            var msCorLibjarStubFile = JavaCompile.createJarStubForDotNetDll(msCorLibDll, IKVMConfig.jarStubsCacheDir);

            Assert.That(File.Exists(msCorLibjarStubFile), "msCorLibjarStubFile didn't exist: {0}", msCorLibjarStubFile);

            JavaCompile.createJarStubForDotNetDll(Path.Combine(dotNetV2Dir, "System.dll"), IKVMConfig.jarStubsCacheDir);
            //JavaCompile.createJarStubForDotNetDll(Path.Combine(dotNetV3Dir, "System.Core.dll"), IKVMConfig.jarStubsCacheDir);
            //JavaCompile.createJarStubForDotNetDll(Path.Combine(dotNetV3Dir, "System.ServiceModel"), IKVMConfig.jarStubsCacheDir);
            JavaCompile.createJarStubForDotNetDll(Path.Combine(dotNetV2Dir, "System.Windows.Forms"), IKVMConfig.jarStubsCacheDir);
        }