Many Eclipse plugins have a version number like 1.2.4-201202017, so the build date (or even the build time) is appended to it. I wonder how it can be achieved automatically. I have the version numbers in feature.xml file, but I don't want to change it and pollute my version control (mercurial) with all the changes in the build date. I thought of using keyword expansion, but it requires some special characters that I don't want to be part of the version number. I build the plugin from within Eclipse so there is no build script to append the date, either.
I used to do something like this:
I appended .qualifier at the end of every plugin xml (feature.xml...), my plugin version looked like this: 0.9.0.qualifier
If you open your build.properties file, there should be something like this:
#Enable / disable the generation of a suffix for the features that use .qualifier.
#The generated suffix is computed according to the content of the feature
#generateFeatureVersionSuffix=true
uncomment that, build and hopefully it will work.
If you can get date (in OS) in needed format YYYYMMDD, you can build own keyword for Keywords extension and use it (system command are callable inside keyword definition)
Related
I am using jpegoptim in PhpStorm as external tool.
Works fine when I do select 1 file.
How can I apply that on many JPEG files ?
That's not possible at the moment (not supported).
https://youtrack.jetbrains.com/issue/IDEA-90239
https://youtrack.jetbrains.com/issue/IDEA-97869
Watch these tickets (star/vote/comment) to get notified on any progress.
If you definitely need it in one go (and not calling that External Tools entry once for each file)... then what you may try is:
Select desired files
Use Copy Paths from context menu
Call another External Tools entry that:
Uses $ClipboardContent$ macro
It's some shell/batch script that parses such parameter (splits into separate lines to get individual paths) and then calls actual program in cycle -- once for each file from the parsed parameter.
A bit too complicated as for my liking... Plus, I've not tried it myself so not sure how line ending symbols will be passed here (so it can be parsed in the script).
BTW -- you can assign custom shortcut to particular External Tools entry so you may call it for each file individually -- it will be faster with shortcut than doing the same with the mouse.
In newer Wordpress, there is REST-API in the core.
Previously used plugin (specifically WP-API-1.2.3) had different API base URL (e.g. /wp-json/posts), but the newer one is using different structure (e.g. /wp-json/wp/v2/posts).
In order to be backward compatible, I want to support older version and not changing the base of API - otherwise, all other pages using this service would no longer work.
I found how to change the "wp-json" part, but not namespace "/wp/v2/".
Is there a way around how to use the original base path and in the best case to be sure nothing will go wrong to use the older library instead of the newer core functionality?
Disabling it in functions.php can't solve this issue - it's shutting down the lib.
add_filter('json_enabled', '__return_false');
add_filter('json_jsonp_enabled', '__return_false');
Thanks
Basically, there were 2 things I did and it's working:
rest_url_prefix was the same like in previous version (wp-json), paths were writing over each other (after requesting something like wp-json/posts went through the new core part of WP, not the lib).
function rest_get_url_prefix() {
return apply_filters( 'rest_url_prefix', 'newPrefix' );
}
I didn't click on Settings -> Permalinks -> Save changes
By doing this I am now able to use the original endpoints
I have the next configuration for a build system in PhpStorm:
And it works ok, but I have a problem... my build script needs to receive the name of the file I'm running it on, so, if I build a PHP file, it will run phpcs on it, but if I'm building a CSS or JS file, it will run gulp... with Sublime Text that is possible, is it possible with PhpStorm?
There are no macros support for Run/Debug Configurations -- they are made so they do not depend on a context (currently opened file in editor). In other words -- they are pretty static and all file names/paths are basically hard coded.
For what you are describing (build script).. you need to use External Tools functionality (which can have all of that and made specifically for such tasks). Once created, you can assign custom shortcut to any External Tools entry (check Settings/Preferences | Keymap for that) so it's more convenient to use it.
If you want such script to be called on every file save automatically -- then use File Watchers -- pretty much external tools that will be called for you automatically (once per each file modified).
Since you are doing this for a build script -- maybe you should try to use dedicated (and therefore more appropriate in general) tools? For example: Gulp / Grunt .. or even Phing.
Create external tool:
https://www.jetbrains.com/phpstorm/help/external-tools.html
You can assign hotkey to execute your build command.
Is there a way to get the app config settings from inside my Trigger.io app without having to repeat the values in the parameters module? Specifically, I'm looking to grab the version number.
I've had success (today) with using forge.config.version
Example:
alert(forge.config.version)
This returned the value I had entered into the app's configuration.
It used to be available under forge.config in Javascript, but isn't anymore. For a while it wasn't available under this key (around v. 1.2). It has since reappeared.
Does Jenkins/Hudson have a plugin which invokes something like a Velocity template engine to allows the interpolation of variables into a set of templates in order to generate files?
I have an html page which needs to have the ${BUILD_NUMBER} inserted into it at the proper place each time I do a build.
You can try Groovy Plugin and exploit Groovy's Template Engine feature. Add a Groovy build step and pass ${BUILD_ID} and the path to your HTML template file as parameters. In the build step itself write code that uses ${args[0]},${args[1]} to get the parameters, and then employs SimpleTemplateEngine to process.
I was going to go the Groovy route as suggested (which is a good idea), however instead I took advantage of the fact my build server is on a *Nix OS and instead wrote a line of sed to do the job using the Shell build step.
sed -e '/BUILD_NUMBER/${BUILD_NUMBER}/' ${WORKSPACE}/index.html.template > ${WORKSPACE}/index.html
It just replaces any occurrence of the text: BUILD_NUMBER inside my template file with the Jenkins/Hudson build number. Quick, dirty, but works.