New Gradle plugin for building Enonic XP

Hi all.

Will just inform you about some important changes that you must be aware of when building applications for Enonic XP 6.12 and upwards.

The Gradle plugin that you are use for building Enonic applications are not following the distribution anymore. This helps us improving the build tools without waiting for a new release of XP every time. This means that you will have to fix your builds scripts. It’s required to do for 6.12 and upwards, but you can also fix it if you are on versions below that, but it’s optional.

Before you would probably have something like this in the beginning of your build.gradle file:

buildscript {		 
  plugins {
    repositories {
      mavenLocal()		 
      jcenter()		
      maven {		
          url 'http://repo.enonic.com/public'		
      }		
  }		
	
  dependencies {		
      classpath "com.enonic.xp:gradle-plugin:${xpVersion}"		
  }
}

apply plugin: 'com.enonic.xp.app'
...

Now you can write the same block as:

plugins {
  id 'com.enonic.xp.app' version '1.0.13'
}

All the rest will be the same. You can look at https://github.com/enonic/starter-vanilla for an example of how to use plugin.

4 Likes