Navigation Menu

Skip to content

Commit

Permalink
Added bower && replaced iFrame intergration
Browse files Browse the repository at this point in the history
  • Loading branch information
Marko Schnecke committed Aug 18, 2016
1 parent 4994c30 commit a3f87e1
Show file tree
Hide file tree
Showing 12 changed files with 272 additions and 387 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Expand Up @@ -65,4 +65,8 @@ grails-app/assets/stylesheets/lib
# ci/bamboo specifics
version.properties
# local scripts
scripts/local
scripts/local

# node/bower build files
/node_modules
bower_components
34 changes: 34 additions & 0 deletions bower.json
@@ -0,0 +1,34 @@
{
"name": "open_speed_monitor",
"description": "OpenSpeedMonitor automates web performance measurements based on WebPagetest. It also processes, aggregates and visualizes the results. So it perfectly fits the need for a continuous monitoring of your most important pages.",
"main": "",
"authors": [
"Nils Kuhn <nils.kuhn@iteratec.de>"
],
"license": "Apache-2.0",
"homepage": "https://github.com/iteratec/OpenSpeedMonitor",
"moduleType": [
"es6"
],
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"dependencies": {
"bootstrap": "2.3.2",
"bootstrap-datepicker": "1.6.2",
"components-font-awesome": "4.2.0",
"crossfilter2": "1.3.14",
"dcjs": "2.0.0-beta.32",
"d3": "3.5.17",
"jquery": "2.0.3",
"jquery-ui": "1.10.4",
"reductio": "^0.6.3"
},
"resolutions": {
"crossfilter2": "1.3.14"
}
}
120 changes: 74 additions & 46 deletions build.gradle
@@ -1,6 +1,3 @@
import org.apache.commons.io.FileUtils
import org.apache.tools.ant.taskdefs.condition.Os

/*
* OpenSpeedMonitor (OSM)
* Copyright 2014 iteratec GmbH
Expand All @@ -20,21 +17,6 @@ import org.apache.tools.ant.taskdefs.condition.Os
buildscript {
ext {
grailsVersion = project.grailsVersion

bootstrapFramework = [
version : "2.3.2",
cssPath : "grails-app/assets/stylesheets/lib",
jsPath : "grails-app/assets/javascripts/lib",
useIndividualJs: true,
useLess : true,
// invalidVersionFails : false,
fontAwesome : [
install : true,
version : "4.2.0",
useLess : false,
invalidVersionFails: false
]
]
}
repositories {
mavenLocal()
Expand All @@ -44,11 +26,10 @@ buildscript {
dependencies {
classpath "org.grails:grails-gradle-plugin:$grailsVersion"
classpath 'org.grails.plugins:database-migration:2.0.0.RC4'
classpath "com.siprell.plugins:bootstrap-framework:1.0.3"
classpath "com.bertramlabs.plugins:asset-pipeline-gradle:2.7.4"
classpath 'com.bertramlabs.plugins:less-asset-pipeline:2.9.4'
classpath "org.grails.plugins:hibernate4:5.0.4"
classpath 'com.moowork.gradle:gradle-node-plugin:0.12'
classpath 'com.moowork.gradle:gradle-node-plugin:0.13'
}
}

Expand All @@ -61,7 +42,6 @@ apply plugin: "war"
apply plugin: "org.grails.grails-web"
apply plugin: "org.grails.grails-gsp"
apply plugin: "asset-pipeline"
apply plugin: "com.siprell.plugins.bootstrap-framework"
apply plugin: 'com.moowork.node'

ext {
Expand Down Expand Up @@ -143,48 +123,96 @@ dependencies {
}

}
task wrapper(type: Wrapper) {
gradleVersion = gradleWrapperVersion
}

assets {
minifyJs = true
minifyCss = true
configOptions = [:]
includes = ['bootstrap-custom.less']
excludes = ['**/*.less']
}

node {
//node version to use
version = '6.2.2'
//npm version to use
npmVersion = '3.10.3'
// If true, it will download node using above parameters.
// If false, it will try to use globally installed node.
download = true
// Set the work directory for unpacking node
workDir = file("${project.buildDir}/nodejs")
// Set the work directory where node_modules should be located
nodeModulesDir = file("${project.projectDir}/node_modules")
}


task setupJasmine(type: NpmTask) {
outputs.dir file('node_modules')
args = ['install', '--loglevel', 'error']
npmInstall {
outputs.files file('node_modules')
}

task jasmineRun(type: NodeTask, dependsOn: ['setupJasmine']) {
task jasmineRun(type: NodeTask, dependsOn: ['npmInstall']) {
script = karmaExec
args = ['start', karmaConfig, '--single-run']
}

task jasmineWatch(type: NodeTask, dependsOn: 'setupJasmine') {
task jasmineWatch(type: NodeTask, dependsOn: 'npmInstall') {
script = karmaExec
args = ['start', karmaConfig]
}

test.dependsOn jasmineRun

task wrapper(type: Wrapper) {
gradleVersion = gradleWrapperVersion

task bowerInstall(type: NodeTask) {
script = file('node_modules/bower/bin/bower')
args = ["--config.storage.cache=${gradle.getGradleUserHomeDir()}/caches/bower/cache",
"--config.storage.packages=${gradle.getGradleUserHomeDir()}/caches/bower/packages",
"--config.storage.registry=${gradle.getGradleUserHomeDir()}/caches/bower/registry",
'install']
inputs.files file('bower.json')
outputs.files file('bower_components')
dependsOn npmInstall
}

assets {
minifyJs = true
minifyCss = true
configOptions = [:]
includes = ['bootstrap-custom.less']
excludes = ['**/*.less']
task bowerSyncJavascript(type: Sync) {
from 'bower_components'
into "grails-app/assets/javascripts/bower_components"
include 'jquery/jquery.min.js'
include 'jquery-ui/ui/jquery-ui.js'
include 'bootstrap/docs/assets/js/bootstrap.min.js'
include 'bootstrap/js/*.js'
include 'bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js'
dependsOn bowerInstall
}

task bowerSyncStylesheets(type: Sync) {
from 'bower_components'
into "grails-app/assets/stylesheets/bower_components"
include 'bootstrap/docs/assets/css/bootstrap*.css'
include 'bootstrap/less/*.less'
include 'bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css'
include 'components-font-awesome/css/font-awesome.min.css'
include 'components-font-awesome/fonts/*'
dependsOn bowerInstall
}

task bowerPackages() {
dependsOn bowerSyncJavascript, bowerSyncStylesheets
}

//TODO: this is a workaround for: https://github.com/kensiprell/bootstrap-framework/issues/10
// We will remove bootstrap-framework plugin soon and install bootstrap and font-awesome libraries via bower
assetCompile.dependsOn {[
createBootstrapLess,
createBootstrapJs,
createBootstrapMixins,
createFontAwesomeCssAll,
createFontAwesomeCssIndividual,
createFontAwesomeFonts,
createFontAwesomeLessLess,
createFontAwesomeLess
]}
processResources.dependsOn bowerPackages
assetCompile.dependsOn bowerPackages

clean.delete << file('grails-app/assets/javascripts/bower_components')
clean.delete << file('grails-app/assets/stylesheets/bower_components')
clean.delete << file('node_modules')
clean.delete << file('bower_components')



sourceSets {
main {
Expand Down
18 changes: 3 additions & 15 deletions grails-app/assets/javascripts/application.js
Expand Up @@ -14,21 +14,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
//= require jquery/jquery-1.12.3
//= require jquery/jquery-ui-1.10.4
//= require lib/bootstrap/bootstrap-transition
//= require lib/bootstrap/bootstrap-alert
//= require lib/bootstrap/bootstrap-button
//= require lib/bootstrap/bootstrap-carousel
//= require lib/bootstrap/bootstrap-collapse
//= require lib/bootstrap/bootstrap-dropdown
//= require lib/bootstrap/bootstrap-modal
//= require lib/bootstrap/bootstrap-tooltip
//= require lib/bootstrap/bootstrap-popover
//= require lib/bootstrap/bootstrap-scrollspy
//= require lib/bootstrap/bootstrap-tab
//= require lib/bootstrap/bootstrap-typeahead
//= require lib/bootstrap/bootstrap-affix
//= require_tree bower_components/jquery
//= require_tree bower_components/jquery-ui
//= require_tree bower_components
//= require kickstart/kickstart
//= require kickstart/checkboxes
//= require date-time-picker/bootstrap-datepicker.min
Expand Down

0 comments on commit a3f87e1

Please sign in to comment.