Currently there is no popular way to build applications for Sling using Gradle build system. This project contains brand new Gradle plugin to assemble Vault package and deploy it on instance(s).
Incremental build which takes seconds, not minutes. Developer who does not loose focus between build time gaps. Extend freely your build system directly in project.
Sling developer - it's time to meet Gradle! You liked or used plugin? Don't forget to star this project on GitHub :)
Check out live demo presented on official Sling adaptTo() 2018 conference.
This project is a fork of Gradle AEM Plugin.
Almost all of its concepts are applicable to pure Sling so that all of features of GAP 14.x.x are available in GSP. The maintenance and synchronization of two separate plugins may be exhausting, so that any volunteers that will take care about this fork are appreciated. Generally to keep documentation up to date and occasionally transfer code from GAP to GSP and vice versa.
For now, just consider mapping word aem to sling while reading GAP documentation to be able to start work on GSP. This is also applicable to build script, for instance:
sling {
// ...
}
Task names are not changed - are same as in Gradle AEM Plugin.
There are few differences between GAP and GSP, that it is good to be aware.
Sling Plugin has no capabilities to perform queries as of query builder endpoints are available only on AEM. Simply instead of queries:
instance.sync { repository.node("/content").query { /* ... */ } }
Use traversing with filtering:
instance.sync { repository.node("/content").traverse().filter { subnode -> /* ... */ } }
Toggling workflows e.g for a time of deploying package is not available as of there are no such thing as workflows on pure Sling instance.
See: ist-dresden/composum-nodes#199
- Clone this project using command
git clone https://github.com/wttech/gradle-sling-plugin.git
- Enter cloned directory and simply run command:
gradlew
- To use built plugin:
- Add
mavenLocal()
torepositories
section insidepluginManagement
of settings.gradle file. - Ensuring having correct version of plugin specified in settings.gradle file.
- Add
- To debug built plugin:
- Append to build command parameters
--no-daemon -Dorg.gradle.debug=true
- Run build, it will suspend, then connect remote at port 5005 by using IDE
- Build will proceed and stop at previously set up breakpoint.
- Append to build command parameters
Issues reported or pull requests created will be very appreciated.
- Fork plugin source using a dedicated GitHub button.
- Do code changes on a feature branch created from develop branch.
- Create a pull request with a base of develop branch.
Gradle Sling Plugin is licensed under the Apache License, Version 2.0 (the "License")