-
-
Notifications
You must be signed in to change notification settings - Fork 265
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wasm gc: improve gradle plugin settings
- Loading branch information
1 parent
312d8ab
commit 61e4bb5
Showing
12 changed files
with
124 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
tools/gradle/src/main/java/org/teavm/gradle/tasks/TaskUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Copyright 2024 konsoletyper. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.teavm.gradle.tasks; | ||
|
||
import org.gradle.api.file.ConfigurableFileCollection; | ||
import org.gradle.api.provider.Property; | ||
import org.teavm.gradle.api.SourceFilePolicy; | ||
import org.teavm.tooling.TeaVMSourceFilePolicy; | ||
import org.teavm.tooling.builder.BuildStrategy; | ||
|
||
final class TaskUtils { | ||
private TaskUtils() { | ||
} | ||
|
||
static void applySourceFiles(ConfigurableFileCollection sourceFiles, BuildStrategy builder) { | ||
for (var file : sourceFiles) { | ||
if (file.isFile()) { | ||
if (file.getName().endsWith(".jar") || file.getName().endsWith(".zip")) { | ||
builder.addSourcesJar(file.getAbsolutePath()); | ||
} | ||
} else if (file.isDirectory()) { | ||
builder.addSourcesDirectory(file.getAbsolutePath()); | ||
} | ||
} | ||
} | ||
|
||
static void applySourceFilePolicy(Property<SourceFilePolicy> policy, BuildStrategy builder) { | ||
switch (policy.get()) { | ||
case DO_NOTHING: | ||
builder.setSourceFilePolicy(TeaVMSourceFilePolicy.DO_NOTHING); | ||
break; | ||
case COPY: | ||
builder.setSourceFilePolicy(TeaVMSourceFilePolicy.COPY); | ||
break; | ||
case LINK_LOCAL_FILES: | ||
builder.setSourceFilePolicy(TeaVMSourceFilePolicy.LINK_LOCAL_FILES); | ||
break; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters