Modify vcx project file using bat file - vcxproj

Modify vcx project file using bat file
.
I need to add preprocessor from batch file to vcxproj file insted of adding it in visulat studio GUI
<!-- begin snippet: js hide: false console: true babel: false -->
project file using bat file

Related

Can js file be compiled in a different folder from the source folder?

I'm building an Obsidian plugin, and it uses esbuild to bundle ts file to js file. The ts file is located at D:\foo1\foo2\..., and I want the js file to be at D:\bar1\bar2\.... The reason for this is because I want the source folder is in a different folder than the plugin folder, so that when syncing it to mobile I don't have to exclude the source files.
I was suggested to edit the esbuild.config.mjs file, and I find in the documentation that beside the outfile config there are also outdir, outbase. However, these are the results when I'm using them:
outdir
outdir: 'D:\Quả Cầu\B Nội dung\Knowledge graphs\Cây vấn đề\.obsidian\plugins\dotmaker'
error: Failed to create output directory: mkdir D:\GitHub\Obsidian\dotmaker\D:Quả CầuB Nội dungKnowledge graphsCây vấn đề.obsidianpluginsdotmaker: The directory name is invalid.
outbase
outbase: 'D:\Quả Cầu\B Nội dung\Knowledge graphs\Cây vấn đề\.obsidian\plugins\dotmaker',
It prints the js content in the terminal, but the real file isn't changed.
It seems that I can only create the js file inside the source folder. Is that possible?
You didn't correctly format the content of the outdir setting. When using backslashes \ as path separator on windows, you have to escape them. Ie use
outdir: 'D:\\Quả Cầu\\B Nội dung\\Knowledge graphs\\Cây vấn đề\\.obsidian\\plugins\\dotmaker'

LESSC Compiling Included Files Into CSS

I have the following file structure:
--public_html/
- css/
- less/
- _mixins.less
- _variables.less
- _theme.less
- main.less
I am using PhpStorm with a File Watcher running LESSC from NPM.
My file watcher is as follows:
Program: /usr/local/bin/lessc
Arguments: --no-color $FileName$
Output paths to refresh: ../$FileNameWithoutExtention$.css
Files:
main.less:
#import "_variables.less";
#import "_mixins.less";
#import "_theme.less";
_theme.less contains my stylsheet and _variables.less and _mixins.less are all pretty self explanatory.
When I modify and save main.less The file main.css is created in the css folder as it should.
However, when I edit my _theme.less file, LESSC creates a _theme.css file, also.
How do I stop these extra files being created?
If you need any more info, please ask.
Please ensure that Track only root files option is enabled in that particular File Watcher settings -- it does just that.
From https://www.jetbrains.com/help/phpstorm/2016.3/new-watcher-dialog.html#d199014e291
When the File Watcher is invoked on a file, PhpStorm detects all the files in which this file is included. For each of these files, in its turn, PhpStorm again detects the files into which it is included. This operation is repeated recursively until PhpStorm reaches the files that are not included anywhere within the specified scope. These files are referred to as root files (do not confuse with content roots).
When this check box is selected, the File Watcher runs only against the root files.
When the check box is cleared, the File Watcher runs against the file from which it is invoked and against all the files in which this file is included recursively within the specified scope.

Visual Studio: Handling Typescript and LESS project files (with TFS Build)

I currently have an ASP.Net MVC project setup that uses .less files and standard .js files.
My less files get compiled when they're saved by the Web Essentials Visual Studio extension, and appear like so:
One annoying thing I have to do is set the less file's Build Action to 'None' so it doesn't end up in the built files on the server, but that's manageable.
I've added the TypeScript extension to Visual Studio, and I'm starting to convert my .js files over to .ts files. Similar to the .less files, they will be recompiled when I save the .ts file; however, the .js file is not added to my project. This is an issue since TFS won't have the .js file for its build (and won't compile the file, since that TypeScript tool doesn't exist there).
I can add the .js file to the project, and then hack the project file to make it a dependency:
However, this process also seems like a bit of a pain. So to my question: What is the correct approach I should be taking here?
1) Do not include .css and .js files in TFS, and find a way to have our TFS server compile these during build (add the .ts extension somehow, and is there a build action for compiling .less?).
2) Include all files like I'm currently doing, but find a better way of adding .ts files (without editing the project file) and .less files (without needing to change the build action).
So far I haven't been able to find a good solution for either route.
Go with option 1. Only commit the Less and Typescript files and let the build system generate the css and Javascript.
Since asking this question, we've upgraded to Visual Studio 2015 and left TFS for Atlassian, but this should still be applicable:
I deleted all generated css files and added the following gulpfile.js to the project:
/// <binding AfterBuild='less' ProjectOpened='less-watch' />
var gulp = require('gulp');
var less = require('gulp-less');
var watch = require('gulp-watch');
var path = require('path');
var plumber = require('gulp-plumber');
var concat = require('gulp-concat');
var lessPaths = [*my file paths*];
gulp.task('less', function () {
return gulp.src(lessPaths, { base: "./" })
.pipe(plumber())
.pipe(less())
.pipe(concat('app-styles.css'))
.pipe(gulp.dest('./styles/'));
});
gulp.task('less-watch', function () {
gulp.watch(lessPaths, ['less']);
});
This concats all of my generated files into a '/styles/app-styles.css' file. From there, we need to add the following to the .csproj file to get this new file copied into our output folder on build/deploy:
<Target Name="GulpTasks" AfterTargets="AfterBuild">
<Exec Command="npm install" />
<Exec Command="node_modules\.bin\gulp less" />
<Copy SourceFiles="styles\app-styles.css" DestinationFolder="$(WebProjectOutputDir)\styles" />
</Target>

Yeoman, Grunt, and the rev and usemin tasks

Using the webapp generator, I have created a yeoman project. I have some html templates in the app folder in a 'templates' directory. I am able to get these files revved when running grunt build; however, I am not able to update to references to the html templates in the js files in the 'scripts' directory. Is it possible to use the usemin task on js files or is it a bad idea to rev html templates used by js files in the first place?
Before building:
-root
-app
index.html
-templates
template1.html
-scripts
script1.js (used template1.html)
After building:
-root
index.html
-templates
43643.template1.html
-scripts
345345.script1.js (does not update ref to template1.html)
My gruntfile is pretty basic, just added directories to the rev task. Any suggestions would be appreciated. Thanks in advance.
you can use patterns like in the following question: Using grunt-usemin with dynamically generated image paths
I used this to search revisoned js files into other js files.
When you do this, bear in mind that you have to write all relative path in the, in my case I had to change something like:
...
var file = basePath + 'filename.js';
...
to
...
var file = 'base/path/filename.js';
...
Cheers,

How to fill ini file for creating exe for Java app with libs (WinRun4J)

"MyApp" folder has now the following structure:
- MyApp
- lib
- MyLib.jar
- MyApp.jar
MyApp.jar has a manifest with Class-Path: lib/MyLib.jar
I want to add MyApp.exe file to "MyApp" folder. So I put all files required to create exe via WinRun4J to "MyApp" folder. Then I run bat file as described here. That gives me exe file with a proper icon but all I see when I run it is a splash screen. Where am i wrong? My ini file content:
main.class=my.main.class
classpath.1=lib/MyLib.jar
splash.image=SplashScreen.gif
You will have to include your main jar as well:
main.class=my.main.class
classpath.1=MyApp.jar
classpath.2=lib/MyLib.jar
splash.image=SplashScreen.gif
or to simply include all jars:
main.class=my.main.class
classpath.1=*.jar
classpath.2=lib/*.jar
splash.image=SplashScreen.gif

Resources