Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/add reference #28

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

Vad1mo
Copy link
Contributor

@Vad1mo Vad1mo commented Jul 22, 2016

  • Allows to pass references to IKVM
  • Now it is also possible to download newer (>8.x) IKVM versions which are hosted on the IKVM Authors website http://www.frijters.net

I also added the dependency 'commons-io:commons-io:2.5' without it the project didn't compile.

Vad1mo added 2 commits July 22, 2016 16:39
- allow to download from  beta releases from frijters.net
@@ -204,6 +205,9 @@ class Ikvm extends ConventionTask {
if (platform) {
commandLineArgs += "-platform:${platform}"
}
if (reference) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason not to use the supported list of references (through the configuration)? (maybe lack of documentation on how to use it ?) - see getReferences()

@Vad1mo
Copy link
Contributor Author

Vad1mo commented Aug 1, 2016

I planned to implement the -reference:library-filespec in http://www.ikvm.net/userguide/ikvmc.html

Is it the same as getReferences if yes how do I use it?

What I want is to compile against .NET 2.0
ikvmc ... -reference:/Library/Frameworks/Mono.framework/Versions/3.12.1/lib/mono/2.0/mscorlib.dll

@gluck
Copy link
Contributor

gluck commented Aug 1, 2016

today you can add references using a configuration like:

dependencies {
    ikvmCompile group: 'foo', name: 'bar', version: '1.0', type: '.dll'
}

(which will add -reference:PATH_TO/bar.dll to the IKVM command, assuming you have a resolver that'll point towards these)

Where do you need to reference libs from ?

@Vad1mo
Copy link
Contributor Author

Vad1mo commented Aug 1, 2016

Currently I use this command and the dll I am referencing is mscorelib 2.0

mono ../ikvm-8.1.5717.0/bin/ikvmc.exe \
    -out:/dot.NET-$version.dll \
    -version:$version\
    -fileversion:$version \
    -keyfile:/Users../../key.key \
    -removeassertions -compressresources 
    -target:library \
    -nostdlib \
    -reference:/Library/Frameworks/Mono.framework/Versions/3.12.1/lib/mono/2.0/mscorlib.dll \
    /Users/.../myLib-$version.jar

@gluck
Copy link
Contributor

gluck commented Aug 5, 2016

As per https://docs.gradle.org/current/userguide/dependency_management.html#sub:file_dependencies did you try something like:

dependencies {
    ikvmCompile files('/Library/Frameworks/Mono.framework/Versions/3.12.1/lib/mono/2.0/mscorlib.dll')
}

?

@gluck
Copy link
Contributor

gluck commented Aug 5, 2016

Note that after having merged the support for www.frijters.net, I rollback'ed it because it caused CI build issues (timeouts on the URL).
I think it's safer to avoid the extra lookup, users can specify the beta URL if they want using:

ikvm {
    ikvmHome = "http://www.frijters.net/...."
}

Thx

@Vad1mo
Copy link
Contributor Author

Vad1mo commented Feb 22, 2017

I wonder how I could resolve this issue after setting

ikvmCompile files('/Library/Frameworks/Mono.framework/Versions/3.12.1/lib/mono/2.0/mscorlib.dll')

is there some sort of exclude in ikvm or the plugin or -nostdlib support

warning IKVMC0127: Assembly
"/Library/Frameworks/Mono.framework/Versions/3.12.1/lib/mono/2.0/mscorlib.dll" 
is ignored as previously loaded assembly
"/Library/Frameworks/Mono.framework/Versions/4.4.1/lib/mono/4.5/mscorlib.dll" 
has the same identity "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"

I need to compile against mscorlib 2.0 because the dll will be used with an .NET 2.0 application. It seems Its not possible to create a 2.0 compatible version with a 4.5 corlib.

@Vad1mo
Copy link
Contributor Author

Vad1mo commented Nov 16, 2017

@gluck I still have an issue as the mscorlib.dll is added twice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants