diff --git a/build.gradle b/build.gradle index 1cbfbd8f3..cb42da437 100644 --- a/build.gradle +++ b/build.gradle @@ -20,6 +20,7 @@ Properties props = new Properties() props.load(new FileInputStream("${projectDir}/build.properties")) ext.BootsFacesVersion = props['VERSION'] +ext.BootsFacesReleaseStatus = props['RELEASE-STATUS'] //SNAPSHOT or RELEASE //Bootstrap ext.BootstrapVersion = props['bootstrap.version'] //PatternFly @@ -79,5 +80,13 @@ task showConfig { println "--------------------" } } +showConfig.doFirst { + String configClassFile='src/main/java/net/bootsfaces/C.java' + String configClass = new File( configClassFile ).getText( 'UTF-8' ) + configClass=(configClass =~ /BSFVERSION\s*\=\s*\"[v0-9\.]*\"/).replaceFirst('BSFVERSION="'+BootsFacesVersion+'"') + configClass=(configClass =~ /BSFRELEASE_STATUS\s*\=\s*\"\w*\"/).replaceFirst('BSFRELEASE_STATUS="'+BootsFacesReleaseStatus+'"') + //println configClass + new File( configClassFile ).write( configClass, 'UTF-8' ) +} defaultTasks 'showConfig', ':java6:defaultJar', ':java7:jar', ':java8:jar' diff --git a/build.properties b/build.properties index e9e0465c8..e1c474a10 100644 --- a/build.properties +++ b/build.properties @@ -25,6 +25,7 @@ # is an escape character followed by a control character. ######################################################################################################### VERSION=1.0.1 +RELEASE-STATUS=SNAPSHOT bootstrap.version=3.3.7 # Set global properties for this build diff --git a/src/main/java/net/bootsfaces/C.java b/src/main/java/net/bootsfaces/C.java index 11b4a4cdf..104e6bb4e 100644 --- a/src/main/java/net/bootsfaces/C.java +++ b/src/main/java/net/bootsfaces/C.java @@ -1,8 +1,8 @@ /** * Copyright 2013-2016 Riccardo Massera (TheCoder4.Eu) - * + * * This file is part of BootsFaces. - * + * * 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 @@ -21,39 +21,41 @@ /** * String Constants valid for the whole Framework - * + * * @author thecoder4.eu */ public final class C { /** * BootsFaces Library Constants */ - public static final String BSFCOMPONENT= "net.bootsfaces.component"; - public static final String BSFLAYOUT = "net.bootsfaces.layout"; - //public static final String BSFRENDER = "net.bootsfaces.render"; - + public static final String BSFVERSION="1.0.1"; + public static final String BSFRELEASE_STATUS="SNAPSHOT"; //SNAPSHOT or RELEASE + public static final String BSFCOMPONENT= "net.bootsfaces.component"; + public static final String BSFLAYOUT = "net.bootsfaces.layout"; + //public static final String BSFRENDER = "net.bootsfaces.render"; + //Theme public static final String BSF_LIBRARY="bsf"; public static final String P_USETHEME ="BootsFaces_USETHEME"; public static final String P_THEME ="BootsFaces_THEME"; - + //Font Awesome //public static final String P_USEFONTAWESOME ="BootsFaces_USE_FA"; public static final String FA_VERSION="4.7.0"; public static final String FONTAWESOME_CDN_URL="//maxcdn.bootstrapcdn.com/font-awesome/"+FA_VERSION+"/css/font-awesome.min.css"; - + //Meta tags - // default yes. to disable set to 'no' or 'false'. if you want to change, set to the value you want to use - public static final String P_VIEWPORT = "BootsFaces_USE_VIEWPORT"; - + // default yes. to disable set to 'no' or 'false'. if you want to change, set to the value you want to use + public static final String P_VIEWPORT = "BootsFaces_USE_VIEWPORT"; + /** * Component Types */ //Components public static final String W_NONAVCASE_LINK="This link is disabled because a navigation case could not be matched."; public static final String W_NONAVCASE_BUTTON="This link is disabled because a navigation case could not be matched."; - - + + // Suppress default constructor for noninstantiability private C() { throw new AssertionError(); diff --git a/src/main/java/net/bootsfaces/listeners/AddResourcesListener.java b/src/main/java/net/bootsfaces/listeners/AddResourcesListener.java index f8be2a029..8789a3f27 100644 --- a/src/main/java/net/bootsfaces/listeners/AddResourcesListener.java +++ b/src/main/java/net/bootsfaces/listeners/AddResourcesListener.java @@ -82,7 +82,8 @@ public class AddResourcesListener implements SystemEventListener { CSS_RENDERER = "javax.faces.resource.Stylesheet"; static { - LOGGER.info("This application is running on BootsFaces 1.0.1-SNAPSHOT"); + LOGGER.info("This application is running on BootsFaces"+C.BSFVERSION+"-"+C.BSFRELEASE_STATUS); + //LOGGER.info("This application is running on BootsFaces 1.0.1-SNAPSHOT"); } /**