Step 1. Add the JitPack repository to your build file
Add it in your root settings.gradle at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Add it in your settings.gradle.kts at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}
Add to pom.xml
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Add it in your build.sbt at the end of resolvers:
resolvers += "jitpack" at "https://jitpack.io"
Add it in your project.clj at the end of repositories:
:repositories [["jitpack" "https://jitpack.io"]]
Step 2. Add the dependency
dependencies {
implementation 'com.github.nugetmonkey:gradle-nugetmonkey-plugin:3.5.5-SNAPSHOT'
}
dependencies {
implementation("com.github.nugetmonkey:gradle-nugetmonkey-plugin:3.5.5-SNAPSHOT")
}
<dependency>
<groupId>com.github.nugetmonkey</groupId>
<artifactId>gradle-nugetmonkey-plugin</artifactId>
<version>3.5.5-SNAPSHOT</version>
</dependency>
libraryDependencies += "com.github.nugetmonkey" % "gradle-nugetmonkey-plugin" % "3.5.5-SNAPSHOT"
:dependencies [[com.github.nugetmonkey/gradle-nugetmonkey-plugin "3.5.5-SNAPSHOT"]]
This plugin allows to compile the project jar into a .Net assembly using IKVM. It supports various IKVM flags, and also allows for .Net API documentation generation.
Below tasks are provided by the plugin, if you apply the ikvm
plugin. You can alternatively apply just the ikvm-base if you want to create your custom tasks.
This task depend on standard jar
task, and builds the corresponding assembly.
It can be configured by a usual gradle convention.
Simplest usage:
Build script snippet can be used in all Gradle versions:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath "com.nugetmonkey.gradle:gradle-nuget@-plugin:2.3"
}
}
apply plugin:'java'
apply plugin:'ikvm'
repositories {
mavenCentral()
}
Build script snippet can be used instead with Gradle 2.1+
plugins {
id "com.nugetmonkey.nugetmonkey" version "2.3"
}
More options:
// ikvmCompile allows to provide 3rd Party DLLs to the process (provided the dlls are available in some repository of yours)
dependencies {
ikvmCompile group: 'foo', name: 'bar', version: '1.0', type: '.dll'
}
ikvm {
// If defined, the plugin will use IKVM_HOME environment variable ...
// ... otherwise it will download (& cache) Ikvm release zip from official download links (sourceforge & www.frijters.net) ...
ikvmVersion = '8.1.5717.0'
// ... but you can also specify the Ikvm folder yourself then this will be used.
ikvmHome = '../ikvm-0.46.0.1'
ikvmDownloadPath = 'https://vorboss.dl.sourceforge.net/project/ikvm/ikvm/${version}/ikvmbin-${version}.zip'
ikvmDownloadPath = 'http://downloads.sourceforge.net/project/ikvm/ikvm/${version}/ikvmbin-${version}.zip'
// Below values have sensible __defaults__ but can be overriden
// input jar(s) to transform to IL (defaults to jar task output)
jars = [ jar.archivePath ]
// Where will the assembly be generated
destinationDir = jar.destinationDir
// Assembly name
assemblyName = project.name
// Assembly version
version = project.version
// KeyFile for assembly signing
keyFile = null
// Generates PDB file for debugging purposes
debug = true
// Generates XML documentation file (from javadoc through custom DocLet)
generateDoc = false
// Whether to handle warnings as errors - not compatible with all IKVM versions
// as it was introduced in IKVM 7. If necessary, use the code specific one
warnAsError = true
// Warning codes that should be considered as errors
warnAsError = [105, 110, 120]
// Other ikvmc options can be set:
// fileVersion, target, main, classloader, delaySign, compressResources, removeAssertions, srcPath ...
//removes the current CLR runtime directory from the search path, you should add reference dependencies manually see ikvmCompile
nostdlib = true
}
When everything is setup correctly just run gradle ikvm
.
This task extends standard javadoc
task, and allows XML documentation to be generated for the assembly.
It depends on ikvm
task, and uses a custom DocLet to generate the documentation.
Note: you can also have the documentation generated by ikvm
task, using generateDoc = true
.
Sample usage: either invoke gradle ikvmDoc
or customize it:
task myDoc(type: IkvmDoc) {
// customize javadoc options here
}
All these plugins are licensed under the Apache License, Version 2.0 with no warranty (expressed or implied) for any purpose.