WebCompiler skipping an scss file in CI build - css

I have two scss files in my project that need to be compiled during my CI build (on Azure Pipelines). One is getting compiled when I build locally, and one is not. I'm using WebCompiler and the output to the log shows the one file that is working, but doesn't show any error for the missing file. My CI build is being handled by Azure Pipelines in the Devops suite and for some reason the CI build is working differently than the local build.
Originally I was missing the "Content" designation on the BuildAction for the file that doesn't get compiled. I have corrected that, but it still isn't getting compiled. I have confirmed the contents of the compilerconfig.json file and both files are there.
Here is the compilerconfig.json
[
{
"outputFile": "Content/custom-bootstrap.css",
"inputFile": "Content/custom-bootstrap.scss"
},
{
"outputFile": "Content/Site.css",
"inputFile": "Content/Site.scss"
}
]
And here is a snippet from the CI build Log file (originating from Azure Pipelines).
WebCompile:
WebCompiler: Begin compiling compilerconfig.json
WebCompiler installing updated versions of the compilers...
Compiled Content/custom-bootstrap.css
Minified Content/custom-bootstrap.min.css
WebCompiler: Done compiling compilerconfig.json
And here is a snippet from a local build log.
5> WebCompiler: Begin compiling compilerconfig.json
5> Compiled Content/custom-bootstrap.css
5> Minified Content/custom-bootstrap.min.css
5> Compiled Content/Site.css
5> Minified Content/Site.min.css
5> WebCompiler: Done compiling compilerconfig.json
Any help would be greatly appreciated.

Solved my own issue...
It looks like the WebCompiler, when running from the command line, will not overwrite an existing css file.
I couldn't get the WebCompiler to compile this css within the context of my azure build so I left the css committed to my source code repo. Overwrite occured just fine in local builds. After leaving my project for a few months (no new development or deployments) I had a renewed interest in figuring this out. Turns out that removing the css file is now allowing WebCompiler to create the css for the deployment package. Not sure why I didn't try this long ago, but happy to be past this issue.

Related

Including a file in WEB-INF/lib

I am porting AXIS 2 SOAP webservice to an existing grails 2.4.4 project.
It works flawlessly when run from the IDE but not fram a WAR.
I have tracked this down to addresing.mar NOT being copied to the WEB-INF lib directory. If I copy this file myself then ever thing works fine.
We are using Jenkins for CI and using the Grails plugin to do the compilation of and packaging of the WAR file.
This does not include the addresing.mar file. Also when running the Grails war command it is not included.
I have tried many way to get this to be included. The AXIS plug in just wrecks the compile to teh extent that it is unusable.
I have just spent 2 days googling and tried ever thing I can find in just about every combination.
We are now getting to the point we we are considering post processing the war file and adding the addresing.mar file directly.
Though that will work it would not help my understanding of what I am doing wrong!
Any help most appreciated.
Try saving your file inside the /src file. Grails autowires external libraries when saved inside this folder.
Note: This is only applicable to Grails versions running less than 3.x.x
I don't know too much about AXIS 2 SOAP and the mentioned addressing.mar file but if it's available in the project while building the war file you could use the grails.war.resources parameter in BuildConfig.groovy and simply copy it into the lib directory in the following way:
grails.war.resources = { stagingDir, args ->
copy(file: "path/to/addressing.mar", todir: "${stagingDir}/WEB-INF/lib/")
}
more info about grails.war.resources in the manual

Typescript compile on build not working

I have VS2015 and ASP.NET 5 RC1 project with some typescript files. Files are located in scripts folder and tsconfig is in this folder too. When I'm saving typescript file, js file is generated and everything is ok. But js files are not generated during build.
I have VS2013 installed also and some old projects using typescript, so may be there are some problems cause I have many TypeScript versions and many VS versions.
How can I troubleshoot compiling typescript during build? Build log says nothing about typescript. Checkbox 'Compile TypeScript on build' is project settings is enabled. In old ASP.NET projects TypeScript is enabled via custom target in csproj and it's easy to troubleshoot. But in xproj I don't see any typescript related things.
My current working solution is to add postbuild event which manually calls TypeScript compiler.
project.json:
"scripts": {
"postbuild": ["tsc -p scripts\\tsconfig.json"]
}
(assumes you have tsc in your PATH variable)
make sure this is added in your solution file
"Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')"
I had the exact same issue. Worked for me when I edited tsconfig, and placed compileOnSave BEFORE compilerOptions in tsconfig:
{
"compileOnSave": true
"compilerOptions": {
....
},
}

How to use Laravel 5 with Gulp, Elixir and Bower?

I am completely new to all this, 'Bower' and 'Gulp' and Laravel 'Elixir'. I purchased a template that uses them (unfortunately) and now I need some help on how to go about implementing them. I have already installed NPM and Bower. All my packages have been downloaded into:
resources > assets > vendor
This is a screenshot:
Now my question is how do I include all those packages I downloaded in my view? From my understanding I can't run less files directly in the browser, it only runs once due to 'browser caching' or something like that, also the JS scripts are just too many to include in my page.
I want a way where I can work on my files and have them automatically compiled with the compiled files being referenced in my app.php file.
This is a link to the GulpJS file included in my template: http://pastebin.com/3PSN6NZY
You do not need to compile every time someone visits. The compiled sass/js should be run in dev and then the output files referenced.
If you have gulp installed on the project, you should see a gulp.js file in the root of your project. If not, visit here for instructions:
Gulp/Elixer installation and setup
In your gulp.js file:
var elixir = require('laravel-elixir');
elixir(function(mix) {
mix.less([
'app.less',
'normalize.less',
'some-other-less.less',
'and-another.less'
]);
mix.scripts(['app.js', 'some-other-js.js'], 'public/js/output-file.js');
});
While in development you can run gulp watch from the command line to listen for changes and run compile tasks when it hears a change. Then you simply reference the output files in the public directory as you normally would.
If you don't want to listen, you can just run the gulp command for a single once-off task run.
The docs are pretty straight forward and can be found here:
Gulp/Elixer docs

exclude directory from deployment (like tests)

i want to have a directory that is not deployed to the server, nor is it packaged to be sent to the clients.
I read the 'tests' dir behaves this way, but i don't want to store all my files that don't nee deployment in the tests dir. tests is just for tests...
I want to include my sass files (.scss) in my project, but only the compiled css needs to be deployed (I compile to client/style.css). All of the sass source files and compass configuration files don't need to be deployed anywhere.
How to do this?
I hope I don't need to stor everything in the tests dir...
Thanks!
Pieter
As stated in this other SO, directories whose name start with a dot (Unix hidden directories) aren't included by meteor. I use it for my less partials: client/css/.partials/_<partial_name>.less.
You could modify Meteor's app/lib/bundler.js, line 37 to include your extension:
var ignore_files = [
/~$/, /^\.#/, /^#.*#$/,
/^\.DS_Store$/, /^ehthumbs\.db$/, /^Icon.$/, /^Thumbs\.db$/,
/^\.meteor$/, /* avoids scanning N^2 files when bundling all packages */
/^\.git$/, /* often has too many files to watch */
/*.scss$/
];
or you could make package.js for your sass files, using stylus as an example.

h5bp build script - update css reference automatically?

When I build my h5bp project, the published html files do not include an updated reference to the versioned css file (they still point to 'css/style.css' rather than the newly made css file). The index.html file is the one exception to this.
Is there a step that I am missing while creating the site or while running $ ant build?
Thanks
It seems there is a mismatch between the stable h5bp version and the current version of their ant-build script. The ant-build script assumes a different directory layout for JS files.
Anyway, they've included some compatibility options in "/build/config/project.properties". Look for the paragraph starting with "# Compatibility with older versions of html5boilerplate", uncomment the following lines and build again. It should work now.

Resources