Skip to main content

More Gradle goodness for Domino

I created new release of plugin for integration of headless Domino Designer into Gradle builds. Biggest changes are:
  • 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
 All changes follow Gradle convention over configuration paradigm, so usage is now even easier.

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 directory

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:
dominoLibDir=C:\\gradle-lib
It 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 {

    dependencies {
        classpath fileTree(dominoLibDir)
       
    }
}

apply plugin: 'domino'
That's all. Just tell Gradle that it should use our plugin.

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 check sources, there are more parameters to change wait time, location of data directory (which is read form notes.ini), location of notes program directory (which is C:\IBM\Notes by default)

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 {

    dependencies {
        classpath fileTree(dominoLibDir)
       
    }
}

apply plugin: 'domino'
domino.dominoServer = 'dev.pradny.com'
Now just run gradle buildToServer  and you should get first created nsf locally and then copied to your server.

What's next

There are two features that need to be added. Integration with test framework and filling nsf with test data. UI testing can be added now using standard Gradle tools, data manipulation may require some DXL processing or OpenNTF Domino API.

Notice

Sometimes Designer get stuck during load. I don't know why and since it did that even when I didn't change build logic it's probably some bug that is caused by being just Tech-preview. Usually killing designer.exe and nlnotes.exe helped. If this gets too common, I might introduce mechanism in build file that would do that automatically

Comments

Popular posts from this blog

Microsoft Word black box in numbering issue

This is awkward post, primarily to save the solution for future me. I have seen many people mentioning this problem over years and as I've struggled with it several times, I needed to find final and permanent solution.


All editions of Microsoft Word from time to time suffer from bug in numbering. Instead of a number, black box is displayed. Sometimes it happens right after document is opened, sometimes during editing. Probably some internal structure of document gets corrupted, so based on level of corruption, different fixes could help. Many of them are listed at https://answers.microsoft.com/en-us/office/forum/office_2010-word/ms-word-header-styles-are-showing-black-boxes/c427b21c-dcda-46ce-a506-b9a16c9f2f3f


I took different approach. Since docx is just standard zip package with xml files, I decided to try if I can fix it manually. And it worked.

When I extracted the docx, there was file called numbering.xml in word folder. When I examined that file, I found strange section in h…

Using JAX-RS inside NSF

Last week Christian G├╝demann published new release of SmartNSF on OpenNTF that contains cool new feature that Christian tweeted before. With new CUSTOM strategy it allows direct execution
of Java code from REST API defined in router configuration. It's even better than it sounds as it initializes facesContext and XPages application if needed, so even access to beans works.

I needed to start to build new REST APIs for few databases, so I decided to test new SmartNSF option and also other available options for REST APIs on Domino (there are several, check references at the end for more info). Since CUSTOM strategy requires dependency on SmatNSF in NSF project and also implementation of CustomRestHandler interface, it'd force me to do more changes in my code that I wanted to. If I need to change my code, why not adjust it for JAX-RS spec anyway.

Existing Domino JAX-RS options had to packaged as plugins, which make it hard to call code that is currently in NSF. I could make it wor…

WSL, HCL Volt and some Docker

My list of new technologies to try was growing fast in past months, but now I finally can try to catch up with all the cool improvements that can be used to enhance my/your dev experience.
Microsoft has enhanced the Windows Subsystem for Linux this year and Docker completely changed the way Docker Desktop for Windows is integrated into the operating system. The most important change for me was that I can finally run Docker Desktop and VMWare Workstation on my machine in parallel. When I was looking for some good use cases to try how it works, HCL Domino was a logical choice. HCL started to even publish official Docker images for every release and some pre-releases are only available as Docker images. I have many test Domino machines running in VMs, but I had no HCL Volt. If you don't know that HCL Volt is - it's a new low-code platform that brings HCL Form Builder experience, now know as HCL Leap, to HCL Domino, which then serves as a data store and application server. When I…