<< Back to previous view

[CLJCLR-25] Clojure.Compile.exe create single dll for all compiled .clj files Created: 02/Aug/13  Updated: 14/Sep/13

Status: Reopened
Project: ClojureCLR
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Major
Reporter: Devin Garner Assignee: David Miller
Resolution: Unresolved Votes: 1
Labels: None

Attachments: Text File 0001-PATCH-Add-NDesk.Options-ManyConsole-via-NuGet-to-all.patch    
Patch: Code

 Description   

I've created a patch for ClojureCLR that allows the Clojure.Compile.exe to build a single .dll or .exe when given a list of .clj files. This is basically the same concept as the ILMerge, but it gives the benefit to the programmer with a project containing many .clj files, rather than only to clojure.dll itself.

The merged/separate option can be specified at the commandline, so users can choose the previous method if they prefer.

I didn't remove ILMerge from the ClojureCLR build process, but it should theoretically be easy to do if desired.

ILMerge is working, but its license doesn't allow redistribution & would require each programmer to learn to use the tool (unless its built into nLeiningen & vsClojure). It seems better if Clojure.Compile.exe doesn't make tons of dlls in the first place.

The basic usage is:

Clojure.Compile.exe -include test.clj -include test2.clj -outputAssemblyName test.dll
-or-
Clojure.Compile.exe -i test.clj -i test2.clj -o test.dll

If you leave off the -o parameter, it functions the same as previously.



 Comments   
Comment by David Miller [ 14/Sep/13 2:37 PM ]

Simplified CLI to
Clojure.Compile.exe [-o outputAssemblyName] cljFileName...

Comment by David Miller [ 14/Sep/13 3:14 PM ]

I thought I had run the test suite one last time before committing – apparently not. The fix committed as 7745dec blows three tests. One test shows the :arglists metadata on functions has the wrong type. Two other tests error out function-serialization.

In addition, :file metadata went from relative paths to absolute paths, so the metadata in distributed ClojureCLR will show the file paths on my development machine.

I'm going to roll this change back until these are fixed.





[CLJCLR-32] RT.load does not correctly map namespace to source file or dll name Created: 30/Jun/14  Updated: 30/Jun/14

Status: Open
Project: ClojureCLR
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Antti Karanta Assignee: David Miller
Resolution: Unresolved Votes: 0
Labels: None


 Description   

When doing (from C#)

RT.load( "my.util", true );

and having directory containing my\util.clj on CLOJURE_LOAD_PATH I get

System.IO.FileNotFoundException: Could not locate my.util.clj.dll or my.util.clj on load path.

I believe the latter is wrong - it should be looking for my\util.clj on load path?

Also, there is a problem with compiled assemblies whose namespace contains -'s. For example, if I have compiled namespace myns.foo-bar (in file myns\foo_bar.clj) it produces myns.foo_bar.clj.dll. If I try to load it like so:

RT.load( "myns.foo-bar", true );
System.IO.FileNotFoundException: Could not locate myns.foo-bar.clj.dll or myns.foo-bar.clj on load path.

I think RT.load should "know" that compiling a namespace with - character in it is mapped to _ on the corresponding dll or source file name.






[CLJCLR-24] build.proj ILMerge target broken Created: 26/Jul/13  Updated: 26/Jul/13

Status: Open
Project: ClojureCLR
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Minor
Reporter: Devin Garner Assignee: David Miller
Resolution: Unresolved Votes: 0
Labels: None


 Description   

When running the command

msbuild /t:Ilmerge /p:Configuration="Release 4.0" build.proj

ILMerge gives an error that "edn" is missing. I added "clojure.edn" to the post build events of Clojure.Compile.csproj and the error went away.






[CLJCLR-11] Simplify integration of Clojure code with existing .NET code Created: 03/Mar/13  Updated: 06/Mar/13

Status: Open
Project: ClojureCLR
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Minor
Reporter: Aaron Craelius Assignee: David Miller
Resolution: Unresolved Votes: 1
Labels: None

Attachments: Text File clojure-hosting2.patch     Text File clojure-hosting.patch    
Patch: Code

 Description   

It would be nice to have a nice high-level wrapper class for key Clojure integration functions. In IronPython for example, there is a IronPython.Hosting.Python class. For ClojureCLR, I created the attached clojure.lang.Hosting.Clojure class which provides three simple functions Require, GetVar, and AddNamespaceLoadMapping (for integrating .clj files into .NET assemblies as embedded resources). This class or one like it is a simple suggestion to make integration with existing code as painless as possible.

Sample usage:

Clojure.GetVar("clojure.main", "main").invoke(); // Starts an embedded Clojure REPL

This is much simpler than:

Symbol CLOJURE_MAIN = Symbol.intern("clojure.main");
Var REQUIRE = RT.var("clojure.core", "require");
REQUIRE.invoke(CLOJURE_MAIN);
RT.var("clojure.main", "main").invoke().



 Comments   
Comment by Aaron Craelius [ 06/Mar/13 8:42 PM ]

This is an updated patch that supercedes the previous patch adds an AddToLoadPath method.





Generated at Sat Jul 26 02:13:28 CDT 2014 using JIRA 4.4#649-r158309.