Generate and install AEM clientlibs using Gruntfile
~0.4.5
shell
npm install grunt-aem-clientlibs-generator-installer --save-dev
`
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
`js
grunt.loadNpmTasks('grunt-aem-clientlibs-generator-installer');
`
The "aem_clientlibs_generator_installer" task
$3
In your project's Gruntfile, add a section named aem_clientlibs_generator_installer to the data object passed into grunt.initConfig().
`js
grunt.initConfig({
aem_clientlibs_generator_installer: {
options: {
cssDirectory: 'test/css',
jsDirectory: 'test/js',
projectPageName: 'keysandstrokes-page',
clientLibName:'clientlibs',
categories: 'keysandstrokes-global,global',
dependencies: [],
embed: [],
channels: [],
packageName: 'keysandstrokes',
packageVersion: '1.0',
packageGroup: 'my_packages',
packageDescription: 'This package is created and installed using aem_clientlibs_generator_installer plugin',
aemInstanceUrl: 'http://localhost:4504/',
force: 'false',
install: 'false',
aemUserName: 'admin',
aemPassword: 'admin'
}
},
});
`
$3
#### options.cssDirectory
Type: String
Default value: 'test/css'
A string value that is used to fetch css files from the provided folder path. you must provide the directory path Ex : test/css
#### options.jsDirectory
Type: String
Default value: 'test/js'
A string value that is used to fetch js files from the provided folder path. you must provide the directory path Ex : test/js
#### options.projectPageName
Type: String
Default value: 'keysandstrokes'
A string value that is used under which page the clientlibs need to be created EX: etc/designs/keysandstrokes.
#### options.clientLibName
Type: String
Default value: 'keysandstrokes'
Provide the clientlib folder name EX: etc/designs/keysandstrokes/clientlibs.
#### options.categories
Type: String
Default value: 'keysandstrokes'
Provide the categories for clientlibs
#### options.dependencies
Type: String
Default value: '[]'
Provide the dependencies for clientlibs
#### options.embed
Type: String
Default value: '[]'
Provide the embed for clientlibs
#### options.channels
Type: String
Default value: '[]'
Provide the channels for clientlibs
#### options.packageName
Type: String
Default value: 'keysandstrokes'
Provide the package name
#### options.packageVersion
Type: String
Default value: '1.0'
Provide the package version
#### options.packageGroup
Type: String
Default value: 'my_packages'
Provide the package group
#### options.packageDescription
Type: String
Default value: 'This package is created and installed using aem_clientlibs_generator_installer plugin'
Provide the package description
#### options.aemInstanceUrl
Type: String
Default value: 'http://localhost:4504/'
Provide the aem instance url
#### options.force
Type: String
Default value: 'false'
The false will not install the package, if it is already installed
#### options.install
Type: String
Default value: 'false'
The true will auto install the package
#### options.aemUserName
Type: String
Default value: 'admin'
Provide the username for AEM instance
#### options.aemPassword
Type: String
Default value: 'admin'
Provide the password for AEM instance
$3
#### Default Options
In this example, the default options are used to do something with whatever. So if the testing file has the content Testing and the 123 file had the content 1 2 3, the generated result would be Testing, 1 2 3.
`js
grunt.initConfig({
aem_clientlibs_generator_installer: {
options: {
cssDirectory: 'test/css',
jsDirectory: 'test/js',
projectPageName: 'keysandstrokes-page',
clientLibName:'clientlibs',
categories: 'keysandstrokes-global,global',
dependencies: [],
embed: [],
channels: [],
packageName: 'keysandstrokes',
packageVersion: '1.0',
packageGroup: 'my_packages',
packageDescription: 'This package is created and installed using aem_clientlibs_generator_installer plugin',
aemInstanceUrl: 'http://localhost:4504/',
force: 'false',
install: 'false',
aemUserName: 'admin',
aemPassword: 'admin'
},
},
});
``