Skip to content

Commit

Permalink
Quick fix to filter out assets.txt file and to delete it before addin…
Browse files Browse the repository at this point in the history
…g new files (#123)
  • Loading branch information
xpenatan authored Jul 10, 2024
1 parent aa26bd3 commit ff56bbd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ public class DefaultAssetFilter implements AssetFilter {
public boolean accept(String file, boolean isDirectory) {
if(isDirectory && file.endsWith(".svn")) return false;
if(file.endsWith(".jar")) return false;
if(file.endsWith("assets.txt")) return false;
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -503,20 +503,25 @@ public static void configAssets(TeaClassLoader classLoader, TeaBuildConfiguratio
useDefaultHTMLIndexFile(classLoader, configuration, webappDistFolder, webappName, webappFolder);
}

if(assetFile.exists()) {
assetFile.delete();
}

boolean generateAssetPaths = configuration.shouldGenerateAssetFile();

ArrayList<AssetsCopy.Asset> alLAssets = new ArrayList<>();
// Copy Assets files
ArrayList<AssetFileHandle> assetsPaths = configuration.assetsPath();
for(int i = 0; i < assetsPaths.size(); i++) {
AssetFileHandle assetFileHandle = assetsPaths.get(i);
ArrayList<AssetsCopy.Asset> assets = AssetsCopy.copyAssets(assetFileHandle, filter, assetsFolder);
if(generateAssetPaths) {
AssetsCopy.generateAssetsFile(assets, assetsFolder, assetFile);
}
alLAssets.addAll(assets);
}

if(assetFile.exists()) {
// Delete assets.txt before adding the updated list.
assetFile.delete();
}

if(generateAssetPaths) {
AssetsCopy.generateAssetsFile(alLAssets, assetsFolder, assetFile);
}

// Copy assets from resources
Expand Down

0 comments on commit ff56bbd

Please sign in to comment.