I am new to less. It sounds appealing!
Goal:
compile one less file to more css files ( for theme based css):
Setup:
main.less imports variables.less (variables contains different color schema's)
Folder structure
\main.less
\variables.less
\theme\christmass\variables.less
\theme\newyear\variables.less
I want to call lesscss for each variables.less (which contains the different colors)
lesscss main.less main.css
lesscss main.less main{theme}.css path={theme_christmaspad}/variables.less
lesscss main.less main{theme}.css path={theme_newyearpad}/variables.less
Problems:
I cant seem to set the pre-build event of visual studio to compile the css! How can I make this work?
This is the error message:
Error 1 The command "lessc" exited with code 9009
I used a different approuch, I did make use of Web Essentials
for every theme i created a file themex.less where I
import main variables (this is not in main file because of error with webessentials)
import main file
import theme variables which ovverrides the main variables
thats it, pretty simple and straightforward.
Related
Backgroud:
I would like to use a third-party library in Android Studio 3.4. The library includes three files:see pics
arm64-v8a/libAnalyticsLib.so
armeabi-v7a/libAnalyticsLib.so
StrideAnalyticsLib.jar.
The class files within "StrideAnalyticsLib.jar" show that they seem to be generated by using SWIG.
I've tried two ways to import this library but still cannot
import StrideAnalyticsLib.*;
But this doesn't allow to access the classes and shows "cannot
resolve symbol ...".
the .so files are with jniLibs
~/main/jniLibs/
~/main/jniLibs/arm64-v8a/libAnalyticsLib.so
~/main/jniLibs/armeabi/libAnalyticsLib.so
the .so files are within libs; At the same time, i added "sourceSets { main{ jniLibs.srcDirs = ['libs']}}" in build.gradle;
~/libs/
~/libs/arm64-v8a/libAnalyticsLib.so
~/libs/armeabi/libAnalyticsLib.so
Both attempts are followed by cleaning and rebuilding the project.I'm very new to Android and couldn't get it work. Could anyone please provide help? Great Thanks!
After I studied the process using SWIG to wrap c/c++ library into the .jar and .so., I realised that the .jar and .so will have same package name so that the .jar can call the .so file.
Because my .jar doesn't work when it's saved in /libs, I instead copied all classes within the .jar and pasted them into the /main folder. Remember to put them outside your package, otherwise the package name of these classes will be changed, which cause my problem. The way of importing .so is correct. Just put the .so files inside /main/jniLibs.
I'm having a problem using Gulp to compile a RequireJS project properly. What I need to do is have gulp create a single distribution file that only includes the file necessary to have the application run.
In our application we are following a modular approach breaking out major pieces of functionality into different repos. So while developing my piece I have RequireJS including angular and many other vendor libraries that are common to all of the projects in the application. However when I go to move my piece into the larger application I no longer need these files in the final output since those dependencies also exist in that application (and having those extra libraries also makes the final distribution file over 300K).
I've tried creating another main.js (called gulp-main.js) file that only includes the dependencies that I need but when I run the gulp process it fails. I don't get an error but it seems to be failing because I'm not including the required dependencies for the project to build successfully. Below is the config object that is being passed to the RequireJS optimize method.
var config = {
baseUrl: 'app/',
mainConfigFile: 'app/main.js',
out: 'dist/app/output.js',
name: 'main'
};
Any ideas on what I could do to either remove the unnecessary vendor files or even split them into a single vendor and a single non-vendor file would really be appreciated. I have already tried using the modules array option but that does not produce the results that I am after since it seems to create a single file for each item defined not a single compiled JS file with all scripts contained within.
Thanks in advance.
When you don't want some file in your final output. add " ! " in Your gulp task's src
example :
gulp.src(['./app/*.js', '!./node_modules/**']) // '!./vendor-libraries-dest to igonore'
I followed the steps in How to share a single library source across multiple projects to add an external library to a project.
My project(s) structure:
Project MyTest1:
Module MyLib
Project MyTest2:
Module MyApp
I edited settings.gradle in MyTest2 and added , ..:MyTest1:MyLib to the include directive. Now, I am able to see and use the external library project from within MyTest2 project. Things work as expected.
However, I see a spurious module ".." alongside MyApp and MyLib. There are no nodes under it and it doesn't seem to cause any problems. I am wondering what exactly is this module for and if there is a way to get rid of it. Regards.
Edit
Both my projects are under a directory C:\MyDev. It appears that, anytime you bring up MyTest2 project, AS modifies a file MyTest2.idea\modules.xml and inserts the following line:
<module fileurl="file://C:/MyDev.iml" filepath="C:/MyDev.iml" />
It then complains that the module was not loaded and creates a fake ".." module. I think this is the root of the problem.
Do not declare ..:MyTest1:MyLib as your include. It will cause many problems. Instead, declare it the following way:
include ':MyLib'
project(':MyLib').projectDir = new File('../MyTest1/MyLib')
I have VS 2012 Premium Update 4 with the recently released (25 Feb 2014) Web Essentials 3.7 for compiling LESS files.
I'm customizing (Twitter) Bootstrap frontend framework by adding my own custom LESS-files to the compilation process:
I have this folder structure:
main-file.less
bootstrap/
less/
[all bootstrap .less files]
custom/
custom-mixins.less
custom-other.less
custom-variables.less
In main-file.less I have:
#import "bootstrap/less/bootstrap";
#import "bootstrap/custom/custom-variables";
#import "bootstrap/custom/custom-mixins";
#import "bootstrap/custom/custom-other";
It appears to make no difference whether I apply the ".less" extensions in the import directives or not.
When compiling main-files.less, I keep getting errors like:
variable #my-label-color is undefined
variable #grid-gutter-width is undefined
Any ideas for what might be wrong?
Sounds like the import order is incorrect. Find out where those variables are defined and make sure that file is imported before the file where the variables are used.
Update
As correctly stated by seven-phases-max variables can be defined after they are used. Therefore more than likely you are using these two variables without actually assigning a value to them or defining them.
It maybe they are defined in a less file which you have not imported. Check where these variables are defined and ensure they are in main-files.less
Are there any known issues with mixing nodejs modules (require) with typescript definition files (d.ts) multiple times over files within a module?
My scenario is that I have a module namespace per folder (much like I would in C#), then I basically compile them all via tsc to an outputted my-module.js. However I keep getting really odd errors like Could not find type HTMLElement but lots of people have pointed out that tsc includes the typescript lib file by default which contains all those types.
I have noticed a few people having odd errors when they are including the same d.ts files over multiple files which are all compiled with the --out flag to get it all into one file, so could this be causing my issues?
An example of my usage would be:
///<reference path="path/to/knockout.d.ts" />
import ko = require("knockout");
This would then be put in each file which requires knockout js, which is at least 10 files in the module i'm trying to compile currently. It just bombs out constantly saying knockout.d.ts cannot find the type HTMLElemet, Element, Document etc.
If you are using external modules (which you are if you have a top level "import" - as shown above), then you can't use the --out switch to combine multiple source files. It is a limitation that with external modules that one source file = one module. With source that is not in an external module (i.e. contributes to the 'global' scope), you can combine input source to one output JavaScript file using --out.
I have no idea about the "could not find HTMLElement" issues. If you can provide a repro (and outline which version you are using) I can take a look.