I created new release of plugin for integration of headless Domino Designer into Gradle builds. Biggest changes are:
Since I renamed the project I also renamed repostiory to https://bitbucket.org/pradnik/gradledominoplugin (sorry for any troubles) .
In future I'll probably add OpenNTF Domino API too, because it's much easier to use when doing more complex stuff (now there is just one createCopy call) .
If you have gradle installed on your machine, you need just 2 files to add to any NSF on disk project to get this running.
First is gradle.properties to set path to libs directory. In previous post I set properties from command-line, but then the command is to long to type, so you might want to add those properties somewhere else. You can add this file to the project, or your home directory. There is resolution mechanism in gradle that will take care of it.
Content of the file is simple:
Now to main build file. Since we now full obey convention over configuration, our build file is really simple.
Now from command-line run gradle buildNSF and you should get NSF in your local Notes data directory. Name of the NSF is taken from name of Gradle project, which is name of the directory.
If you want just create nsf called "myCool.nsf" add following lines to your build.gradle
Domino plugin adds extension that currently only contains name of server that you plan to work with. You can set it using domino.dominoServer name, e.g. domino.dominoServer = 'dev.pradny.com'
So your complete build file would look:
- Rename to Gradle Domino Plugin (most projects around are named after Domino not Notes, so I wanted to keep it aligned)
- Added basic error checking and output from HEADLESS.log
- Task for NSF copying
- build-in tasks in plugin for building nsf and copying to server
Since I renamed the project I also renamed repostiory to https://bitbucket.org/pradnik/gradledominoplugin (sorry for any troubles) .
Access to Domino API
One of most important improvements is introduction of DominoAPITask that can wrap any other task that call Domino Java API. For these operation you need to add Notes.jar to your configuration, so it can call required libs. Also you may need to add Notes programm directory to system PATH to find required DLLs.In future I'll probably add OpenNTF Domino API too, because it's much easier to use when doing more complex stuff (now there is just one createCopy call) .
Simplest usage
I also added basic sample and I'll probably add more samples later, instead of more complex documentation. So you might just check Samples/Basic directoryIf you have gradle installed on your machine, you need just 2 files to add to any NSF on disk project to get this running.
First is gradle.properties to set path to libs directory. In previous post I set properties from command-line, but then the command is to long to type, so you might want to add those properties somewhere else. You can add this file to the project, or your home directory. There is resolution mechanism in gradle that will take care of it.
Content of the file is simple:
dominoLibDir=C:\\gradle-libIt is just used in build to tell Gradle where to look for our jars. This folder should contain Notes.jar and GradleDominoPlugin jar
Now to main build file. Since we now full obey convention over configuration, our build file is really simple.
buildscript {That's all. Just tell Gradle that it should use our plugin.
dependencies {
classpath fileTree(dominoLibDir)
}
}
apply plugin: 'domino'
Now from command-line run gradle buildNSF and you should get NSF in your local Notes data directory. Name of the NSF is taken from name of Gradle project, which is name of the directory.
Customization
If you don't like any of defaults, you can change them. buildNSF tasks has following input parameters:- odpPath - change path to On Disk Project
- nsfName - name of target NSF
If you want just create nsf called "myCool.nsf" add following lines to your build.gradle
buildNSF {
nsfName='myCool.nsf'
}
Copying to a server
If you want to get your nsf to a server, you have 2 options. First is to use provided task buildToServer, sencond is to use CopyNSFTask and configure it.Domino plugin adds extension that currently only contains name of server that you plan to work with. You can set it using domino.dominoServer name, e.g. domino.dominoServer = 'dev.pradny.com'
So your complete build file would look:
buildscript {Now just run gradle buildToServer and you should get first created nsf locally and then copied to your server.
dependencies {
classpath fileTree(dominoLibDir)
}
}
apply plugin: 'domino'
domino.dominoServer = 'dev.pradny.com'
Comments
Post a Comment