diff --git a/scripts/Codenarc.groovy b/scripts/Codenarc.groovy index ebdd9060..52d952f8 100644 --- a/scripts/Codenarc.groovy +++ b/scripts/Codenarc.groovy @@ -1,220 +1,220 @@ -/* - * Copyright 2012 Netflix, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/* This script came from the Grails CodeNarc plugin. We are using just the script so that we can control our dependency - * on the CodeNarc library. - */ -import grails.util.GrailsUtil -import org.apache.tools.ant.BuildException - -// Begin hack to replace CodeNarc 0.19's implementation of loadRuleScriptFile which blows up in recent Groovy. -// Remove this hack after https://github.com/CodeNarc/CodeNarc/pull/26 gets merged and released -// in future CodeNarc version to fix https://github.com/CodeNarc/CodeNarc/issues/25 -import org.codenarc.ruleset.RuleSetUtil -import org.codenarc.util.io.DefaultResourceFactory -import org.codenarc.util.io.ResourceFactory - -ResourceFactory RESOURCE_FACTORY = new DefaultResourceFactory() -RuleSetUtil.metaClass.'static'.loadRuleScriptFile = { String path -> - def inputStream = RESOURCE_FACTORY.getResource(path).inputStream - Class ruleClass - inputStream.withStream { InputStream input -> - GroovyClassLoader gcl = new GroovyClassLoader(getClass().classLoader) - ruleClass = gcl.parseClass(input.text) - } - RuleSetUtil.assertClassImplementsRuleInterface(ruleClass) - ruleClass.newInstance() -} -// End temporary hack for compatibility between CodeNarc 0.19 and Groovy 1.8.* - -includeTargets << grailsScript('_GrailsCompile') - -target('codenarc': 'Run CodeNarc') { - depends(compile) - - runCodenarc() -} - -private void runCodenarc() { - ant.taskdef(name: 'codenarc', classname: 'org.codenarc.ant.CodeNarcTask') - - String configClassName = getBindingValueOrDefault('configClassname', 'BuildConfig') - ConfigObject config = loadConfig(configClassName) - - List reports = getConfiguredReports(config) - - int maxPriority1Violations = getConfigInt(config, 'maxPriority1Violations', Integer.MAX_VALUE) - int maxPriority2Violations = getConfigInt(config, 'maxPriority2Violations', Integer.MAX_VALUE) - int maxPriority3Violations = getConfigInt(config, 'maxPriority3Violations', Integer.MAX_VALUE) - String ruleSetFiles = config.ruleSetFiles ?: - 'rulesets/basic.xml,rulesets/exceptions.xml,rulesets/imports.xml,rulesets/grails.xml,rulesets/unused.xml' - List includes = configureIncludes(config) - boolean systemExitOnBuildException = getConfigBoolean(config, 'systemExitOnBuildException') - - configureCodeNarcPropertiesFile(config) - - println "Running CodeNarc ..." - - try { - ant.codenarc(ruleSetFiles: ruleSetFiles, - maxPriority1Violations: maxPriority1Violations, - maxPriority2Violations: maxPriority2Violations, - maxPriority3Violations: maxPriority3Violations) { - reports.each { r -> - report(type: r.type) { - r.each { key, value -> - if (key != 'type') { - option(name:key, value:value) - } - } - } - } - fileset(dir: '.', includes: includes.join(',')) - } - } - catch (BuildException e) { - if (systemExitOnBuildException) { - println "FAILED -- ${e.message}" - System.exit(1) - } - else { - throw e - } - } - - def reportNames = reports.collect { report -> report.outputFile ?: report.type } - println "CodeNarc finished; report(s) generated: ${reportNames}" -} - -private ConfigObject loadConfig(String className) { - ClassLoader classLoader = Thread.currentThread().contextClassLoader - classLoader.addURL(new File(classesDirPath).toURL()) - - try { - return new ConfigSlurper(GrailsUtil.environment).parse(classLoader.loadClass(className)).codenarc - } - catch (ClassNotFoundException ignored) { - return new ConfigObject() - } -} - -private getBindingValueOrDefault(String varName, Object defaultValue) { - Map variables = binding.variables - variables.containsKey(varName) ? getProperty(varName) : defaultValue -} - -class ReportsDslDelegate { - List reports = [] - def methodMissing(String name, args) { - println "Adding report ${name}" - assert args.size() == 2, "Report [${name}] must specify a report type(String or Class) and a Closure" - assert args[0] instanceof String || args[0] instanceof Class, "Report [${name}] must specify a report type" - assert args[0], "The report definition for [${name}] must specify the report type that is not empty or null" - assert args[1] instanceof Closure, "Report name [${name}] must be followed by a Closure" - def reportClosure = args[1] - def report = new Expando() - report.type = args[0] instanceof String ? args[0] : args[0].name - reportClosure.delegate = report - reportClosure.resolveStrategy = Closure.DELEGATE_FIRST - reportClosure.call() - reports << report.properties - } -} - -private List getConfiguredReports(config) { - if (config.reports) { - assert config.reports instanceof Closure, 'The reports property value must be a Closure' - def closure = config.reports - def delegate = new ReportsDslDelegate() - closure.resolveStrategy = Closure.DELEGATE_FIRST - closure.delegate = delegate - closure.call() - return delegate.reports - } - [] -} - -private void configureCodeNarcPropertiesFile(ConfigObject config) { - final PROPERTIES_FILE_PROP = 'codenarc.properties.file' - if (config.propertiesFile) { - def propValue = "file:${config.propertiesFile}" - System.setProperty(PROPERTIES_FILE_PROP, propValue) - } -} - -private int getConfigInt(config, String name, int defaultIfMissing) { - def value = config[name] - value instanceof Integer ? value : defaultIfMissing -} - -private boolean getConfigBoolean(config, String name, boolean defaultValue = true) { - def value = config[name] - value instanceof Boolean ? value : defaultValue -} - -private List configureIncludes(config) { - List includes = [] - - if (getConfigBoolean(config, 'processSrcGroovy')) { - includes << 'src/groovy/**/*.groovy' - } - - if (getConfigBoolean(config, 'processControllers')) { - includes << 'grails-app/controllers/**/*.groovy' - } - - if (getConfigBoolean(config, 'processDomain')) { - includes << 'grails-app/domain/**/*.groovy' - } - - if (getConfigBoolean(config, 'processServices')) { - includes << 'grails-app/services/**/*.groovy' - } - - if (getConfigBoolean(config, 'processTaglib')) { - includes << 'grails-app/taglib/**/*.groovy' - } - - if (getConfigBoolean(config, 'processUtils')) { - includes << 'grails-app/utils/**/*.groovy' - } - - if (getConfigBoolean(config, 'processTestUnit')) { - includes << 'test/unit/**/*.groovy' - } - - if (getConfigBoolean(config, 'processTestIntegration')) { - includes << 'test/integration/**/*.groovy' - } - - if (getConfigBoolean(config, 'processViews', false)) { - includes << 'grails-app/views/**/*.gsp' - } - - for (includeDir in config.extraIncludeDirs) { - includes << "${includeDir}/**/*.groovy" - } - - includes -} - -try { - // Required for Grails 1.3 and later - setDefaultTarget('codenarc') -} -catch (MissingMethodException ignored) { - // Ignore. Older versions of Groovy/Grails do not implement this method -} - +/* + * Copyright 2012 Netflix, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/* This script came from the Grails CodeNarc plugin. We are using just the script so that we can control our dependency + * on the CodeNarc library. + */ +import grails.util.GrailsUtil +import org.apache.tools.ant.BuildException + +// Begin hack to replace CodeNarc 0.19's implementation of loadRuleScriptFile which blows up in recent Groovy. +// Remove this hack after https://github.com/CodeNarc/CodeNarc/pull/26 gets merged and released +// in future CodeNarc version to fix https://github.com/CodeNarc/CodeNarc/issues/25 +import org.codenarc.ruleset.RuleSetUtil +import org.codenarc.util.io.DefaultResourceFactory +import org.codenarc.util.io.ResourceFactory + +ResourceFactory RESOURCE_FACTORY = new DefaultResourceFactory() +RuleSetUtil.metaClass.'static'.loadRuleScriptFile = { String path -> + def inputStream = RESOURCE_FACTORY.getResource(path).inputStream + Class ruleClass + inputStream.withStream { InputStream input -> + GroovyClassLoader gcl = new GroovyClassLoader(getClass().classLoader) + ruleClass = gcl.parseClass(input.text) + } + RuleSetUtil.assertClassImplementsRuleInterface(ruleClass) + ruleClass.newInstance() +} +// End temporary hack for compatibility between CodeNarc 0.19 and Groovy 1.8.* + +includeTargets << grailsScript('_GrailsCompile') + +target('codenarc': 'Run CodeNarc') { + depends(compile) + + runCodenarc() +} + +private void runCodenarc() { + ant.taskdef(name: 'codenarc', classname: 'org.codenarc.ant.CodeNarcTask') + + String configClassName = getBindingValueOrDefault('configClassname', 'BuildConfig') + ConfigObject config = loadConfig(configClassName) + + List reports = getConfiguredReports(config) + + int maxPriority1Violations = getConfigInt(config, 'maxPriority1Violations', Integer.MAX_VALUE) + int maxPriority2Violations = getConfigInt(config, 'maxPriority2Violations', Integer.MAX_VALUE) + int maxPriority3Violations = getConfigInt(config, 'maxPriority3Violations', Integer.MAX_VALUE) + String ruleSetFiles = config.ruleSetFiles ?: + 'rulesets/basic.xml,rulesets/exceptions.xml,rulesets/imports.xml,rulesets/grails.xml,rulesets/unused.xml' + List includes = configureIncludes(config) + boolean systemExitOnBuildException = getConfigBoolean(config, 'systemExitOnBuildException') + + configureCodeNarcPropertiesFile(config) + + println "Running CodeNarc ..." + + try { + ant.codenarc(ruleSetFiles: ruleSetFiles, + maxPriority1Violations: maxPriority1Violations, + maxPriority2Violations: maxPriority2Violations, + maxPriority3Violations: maxPriority3Violations) { + reports.each { r -> + report(type: r.type) { + r.each { key, value -> + if (key != 'type') { + option(name:key, value:value) + } + } + } + } + fileset(dir: '.', includes: includes.join(',')) + } + } + catch (BuildException e) { + if (systemExitOnBuildException) { + println "FAILED -- ${e.message}" + System.exit(1) + } + else { + throw e + } + } + + def reportNames = reports.collect { report -> report.outputFile ?: report.type } + println "CodeNarc finished; report(s) generated: ${reportNames}" +} + +private ConfigObject loadConfig(String className) { + ClassLoader classLoader = Thread.currentThread().contextClassLoader + classLoader.addURL(new File(classesDirPath).toURL()) + + try { + return new ConfigSlurper(GrailsUtil.environment).parse(classLoader.loadClass(className)).codenarc + } + catch (ClassNotFoundException ignored) { + return new ConfigObject() + } +} + +private getBindingValueOrDefault(String varName, Object defaultValue) { + Map variables = binding.variables + variables.containsKey(varName) ? getProperty(varName) : defaultValue +} + +class ReportsDslDelegate { + List reports = [] + def methodMissing(String name, args) { + println "Adding report ${name}" + assert args.size() == 2, "Report [${name}] must specify a report type(String or Class) and a Closure" + assert args[0] instanceof String || args[0] instanceof Class, "Report [${name}] must specify a report type" + assert args[0], "The report definition for [${name}] must specify the report type that is not empty or null" + assert args[1] instanceof Closure, "Report name [${name}] must be followed by a Closure" + def reportClosure = args[1] + def report = new Expando() + report.type = args[0] instanceof String ? args[0] : args[0].name + reportClosure.delegate = report + reportClosure.resolveStrategy = Closure.DELEGATE_FIRST + reportClosure.call() + reports << report.properties + } +} + +private List getConfiguredReports(config) { + if (config.reports) { + assert config.reports instanceof Closure, 'The reports property value must be a Closure' + def closure = config.reports + def delegate = new ReportsDslDelegate() + closure.resolveStrategy = Closure.DELEGATE_FIRST + closure.delegate = delegate + closure.call() + return delegate.reports + } + [] +} + +private void configureCodeNarcPropertiesFile(ConfigObject config) { + final PROPERTIES_FILE_PROP = 'codenarc.properties.file' + if (config.propertiesFile) { + def propValue = "file:${config.propertiesFile}" + System.setProperty(PROPERTIES_FILE_PROP, propValue) + } +} + +private int getConfigInt(config, String name, int defaultIfMissing) { + def value = config[name] + value instanceof Integer ? value : defaultIfMissing +} + +private boolean getConfigBoolean(config, String name, boolean defaultValue = true) { + def value = config[name] + value instanceof Boolean ? value : defaultValue +} + +private List configureIncludes(config) { + List includes = [] + + if (getConfigBoolean(config, 'processSrcGroovy')) { + includes << 'src/groovy/**/*.groovy' + } + + if (getConfigBoolean(config, 'processControllers')) { + includes << 'grails-app/controllers/**/*.groovy' + } + + if (getConfigBoolean(config, 'processDomain')) { + includes << 'grails-app/domain/**/*.groovy' + } + + if (getConfigBoolean(config, 'processServices')) { + includes << 'grails-app/services/**/*.groovy' + } + + if (getConfigBoolean(config, 'processTaglib')) { + includes << 'grails-app/taglib/**/*.groovy' + } + + if (getConfigBoolean(config, 'processUtils')) { + includes << 'grails-app/utils/**/*.groovy' + } + + if (getConfigBoolean(config, 'processTestUnit')) { + includes << 'test/unit/**/*.groovy' + } + + if (getConfigBoolean(config, 'processTestIntegration')) { + includes << 'test/integration/**/*.groovy' + } + + if (getConfigBoolean(config, 'processViews', false)) { + includes << 'grails-app/views/**/*.gsp' + } + + for (includeDir in config.extraIncludeDirs) { + includes << "${includeDir}/**/*.groovy" + } + + includes +} + +try { + // Required for Grails 1.3 and later + setDefaultTarget('codenarc') +} +catch (MissingMethodException ignored) { + // Ignore. Older versions of Groovy/Grails do not implement this method +} + diff --git a/web-app/css/main.css b/web-app/css/main.css index 6f9fa067..869d11c6 100644 --- a/web-app/css/main.css +++ b/web-app/css/main.css @@ -21,6 +21,22 @@ p { padding: 10px 0; } img { border: none; } .titlebar a:link, .titlebar a:visited, .titlebar a:hover { color: #FFF !important; } .titlebar { background-color: #000; color: #FFF; padding: 0 0 0 14px; height: 75px; clear: both; min-width: 831px; } + +.build .titlebar, +.build .titlebar .search, +.build .titlebar .ticket, +.build .titlebar .region { background-color: black; } + +.dev .titlebar, +.dev .titlebar .search, +.dev .titlebar .ticket, +.dev .titlebar .region { background-color: forestgreen; } + +.stage .titlebar, +.stage .titlebar .search, +.stage .titlebar .ticket, +.stage .titlebar .region { background-color: deepskyblue; } + .prod .titlebar, .prod .titlebar .search, .prod .titlebar .ticket, @@ -452,6 +468,9 @@ div.filter input { border: 1px solid #CCC; background-color: #EEF label.choice { padding-right: 15px; } .environment li a { padding: 4px 5px 5px 5px; display: block; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px; } .environment a.test { background-color: black; color: white !important; text-shadow: 2px 2px 1px #E9231B; border: 1px solid #666; } +.environment a.build { background-color: black; color: white !important; text-shadow: 2px 2px 1px #E9231B; border: 1px solid #666; } +.environment a.dev { background-color: forestgreen; color: white !important; text-shadow: 2px 2px 1px #E9231B; border: 1px solid #666; } +.environment a.stage { background-color: deepskyblue; color: white !important; text-shadow: 2px 2px 1px #E9231B; border: 1px solid #666; } .environment a.prod { background-color: #E9231B; color: white !important; text-shadow: 2px 2px 1px black; border: 1px solid #666; } .externalLinks li a { padding: 2px 2px 2px 22px; background: transparent no-repeat 0 1px; display: inline-block; line-height: 16px; min-height: 16px; } diff --git a/web-app/images/occasion/halloween/readme.txt b/web-app/images/occasion/halloween/readme.txt index 66a2215f..9f3679ce 100644 --- a/web-app/images/occasion/halloween/readme.txt +++ b/web-app/images/occasion/halloween/readme.txt @@ -1,49 +1,49 @@ -Desktop Halloween Icons - -License Agreement - -By purchasing icons from Aha-Soft, You (the purchaser) agree -to the terms of this agreement, as detailed below. - -You may use the icons from Aha-Soft in commercial and personal -design projects, software or Internet products. Icons can be -displayed in documentation, help files, and advertising materials. -You are free to sell and distribute products and projects using -purchased icons without further royalty fees. - -All icon files are provided 'as is'. Aha-Soft cannot be held -liable for any negative issues that may occur as a result of -using the icons. - -You agree that all ownership and copyright of the icons remains -the property of Aha-Soft. You may not resell, distribute, lease, -license or sub-license the icons or modified icons (or a subset -of the icons), to any third party unless they are incorporated into -your software or design products. - -If you have any questions regarding copyright or licensing, including -whether another license is required for icon use within products, -please contact us here: http://www.aha-soft.com/support.htm - - -Product page: -http://www.desktop-icon.com/stock-icons/desktop-halloween-icons.htm - -Download demo: -http://www.desktop-icon.com/downloads/desktop-halloween-icons.zip -http://www.icon-files.com/downloads/desktop-halloween-icons.zip - -Icon Design Service - -We can design custom icons for you. Please find the basic information -about ordering icons, pricing and the portfolio here: -www.aha-soft.com/icon-design.htm - - -Notice -Web-site standard-icons.com belongs to Aha-Soft. - - -Support page: http://www.aha-soft.com/support.htm - -Copyright � 2000-2010 Aha-Soft. All rights reserved. +Desktop Halloween Icons + +License Agreement + +By purchasing icons from Aha-Soft, You (the purchaser) agree +to the terms of this agreement, as detailed below. + +You may use the icons from Aha-Soft in commercial and personal +design projects, software or Internet products. Icons can be +displayed in documentation, help files, and advertising materials. +You are free to sell and distribute products and projects using +purchased icons without further royalty fees. + +All icon files are provided 'as is'. Aha-Soft cannot be held +liable for any negative issues that may occur as a result of +using the icons. + +You agree that all ownership and copyright of the icons remains +the property of Aha-Soft. You may not resell, distribute, lease, +license or sub-license the icons or modified icons (or a subset +of the icons), to any third party unless they are incorporated into +your software or design products. + +If you have any questions regarding copyright or licensing, including +whether another license is required for icon use within products, +please contact us here: http://www.aha-soft.com/support.htm + + +Product page: +http://www.desktop-icon.com/stock-icons/desktop-halloween-icons.htm + +Download demo: +http://www.desktop-icon.com/downloads/desktop-halloween-icons.zip +http://www.icon-files.com/downloads/desktop-halloween-icons.zip + +Icon Design Service + +We can design custom icons for you. Please find the basic information +about ordering icons, pricing and the portfolio here: +www.aha-soft.com/icon-design.htm + + +Notice +Web-site standard-icons.com belongs to Aha-Soft. + + +Support page: http://www.aha-soft.com/support.htm + +Copyright � 2000-2010 Aha-Soft. All rights reserved.