peedeeboy edited a comment on issue #1234: FIX: SASS integration is broken - 
removed old parameter "--cache-location"
URL: https://github.com/apache/netbeans/pull/1234#issuecomment-536196075
 
 
   Hi @maxcuttins :)
   
   > Maybei'm in wrong (probably) but I don't think that this is can be set by 
GUI interface.
   
   > However, we have to check if the property can be switched easily.
   It can be set by editing the /etc/netbeans.conf file in a Netbeans 
installation.  There are already a few parameters that are set this way.
   
   If I understand @matthiasblaesing correctly, he is suggesting that as a 
quick fix, we flip the default value so that libsass becomes the default 
implementation instead of RubySASS (as 99% of people will be using libsass 
based implementations of sass nowadays).  
   
   Any legacy RubySASS users can add a parameter to their netbeans.conf file, 
until an option is added to the Netbeans GUI CSS Preprocessor options.
   
   To implement that, you will need to:
   
   **1.  
ide/css.prep/src/org/netbeans/modules/css/prep/sass/SassExecutable.java**
   Revert the changes you made, to restore functionality to RubySASS 
implementations.
   
   **2. ide/css.prep/src/org/netbeans/modules/css/prep/sass/SassCli.java**
   Make libsass the default implementation by making @matthiasblaesing 
recommended change, changing line 56 from:
   ```java
   private static final boolean USE_LIBSASS 
Boolean.getBoolean("nb.sass.libsass", ); // NOI18N`
   ```
   to:
   ```java
   private static final boolean USE_LIBSASS = 
Boolean.parseBoolean(System.getProperty("nb.sass.libsass", "true")); // NOI18N
   ```
   This will make libsass flag default to true unless Netbeans is started with 
the `-J-Dnb.sass.libsass=true` flag
   
   **3. ide/css.prep/src/org/netbeans/modules/css/prep/sass/SassCli.java**
   Make libsass work with the 'Generate Source Maps' option in the Netbeans CSS 
Preprocessor options by:
   Adding the following two lines as member variables (around line 35):
   ```java
   private static final String SOURCEMAP_PARAM = "--source-map"; // NOI18N
   private static final String NO_SOURCEMAP_PARAM = "--no-source-map"; // NOI18N
   ```
   Add the following lines into the `getParameters()` method:
   ```java
   // sourcemaps
   boolean debug = CssPrepOptions.getInstance().getSassDebug();
   if(debug) {
       params.add(SOURCEMAP_PARAM);
   }
   else {
       params.add(NO_SOURCEMAP_PARAM);
   }
   ```
   Those lines should come after:
   ```java
   List<String> params = new ArrayList<>();
   ```
   and before:
   ```java
   // compiler options
           params.addAll(compilerOptions);
   ```
   
   Shout if you get stuck! 👍 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to