Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quick fix to filter out assets.txt file and to delete it correctly in dist folder #123

Merged
merged 1 commit into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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