/** * Responsible for incremental baking, typically a single file at a time. * * @param fileToBake The file to bake */ public void bake(File fileToBake) { Asset asset = utensils.getAsset(); if(asset.isAssetFile(fileToBake)) { LOGGER.info("Baking a change to an asset [" + fileToBake.getPath() + "]"); asset.copySingleFile(fileToBake); } else { LOGGER.info("Playing it safe and running a full bake..."); bake(); } }
@Test public void testIsFileAsset() { File cssAsset = new File(config.getAssetFolder().getAbsolutePath() + File.separatorChar + "css" + File.separatorChar + "bootstrap.min.css"); Assertions.assertTrue(cssAsset.exists()); File contentFile = new File(config.getContentFolder().getAbsolutePath() + File.separatorChar + "about.html"); Assertions.assertTrue(contentFile.exists()); Asset asset = new Asset(config); Assertions.assertTrue(asset.isAssetFile(cssAsset)); Assertions.assertFalse(asset.isAssetFile(contentFile)); }
/** * Responsible for incremental baking, typically a single file at a time. * * @param fileToBake The file to bake */ public void bake(File fileToBake) { Asset asset = utensils.getAsset(); if(asset.isAssetFile(fileToBake)) { LOGGER.info("Baking a change to an asset [" + fileToBake.getPath() + "]"); asset.copySingleFile(fileToBake); } else { LOGGER.info("Playing it safe and running a full bake..."); bake(); } }