Skip to content

Commit

Permalink
Merge branch 'dev' into issue-7314-instancing-support
Browse files Browse the repository at this point in the history
  • Loading branch information
Jhonnyg committed May 16, 2024
2 parents 30d7e0d + 4504340 commit 0325f41
Show file tree
Hide file tree
Showing 148 changed files with 3,302 additions and 1,309 deletions.
63 changes: 34 additions & 29 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,34 +1,39 @@
*.dae binary

# Defold Protocol Buffer Text Files (https://github.com/github/linguist/issues/5091)
*.animationset linguist-language=JSON5
*.atlas linguist-language=JSON5
*.camera linguist-language=JSON5
*.collection linguist-language=JSON5
*.collectionfactory linguist-language=JSON5
*.collectionproxy linguist-language=JSON5
*.collisionobject linguist-language=JSON5
*.cubemap linguist-language=JSON5
*.display_profiles linguist-language=JSON5
*.factory linguist-language=JSON5
*.font linguist-language=JSON5
*.gamepads linguist-language=JSON5
*.go linguist-language=JSON5
*.gui linguist-language=JSON5
*.input_binding linguist-language=JSON5
*.label linguist-language=JSON5
*.material linguist-language=JSON5
*.mesh linguist-language=JSON5
*.model linguist-language=JSON5
*.particlefx linguist-language=JSON5
*.render linguist-language=JSON5
*.sound linguist-language=JSON5
*.sprite linguist-language=JSON5
*.spinemodel linguist-language=JSON5
*.spinescene linguist-language=JSON5
*.texture_profiles linguist-language=JSON5
*.tilemap linguist-language=JSON5
*.tilesource linguist-language=JSON5
# Defold Protocol Buffer Text Files
*.animationset linguist-language=Protocol-Buffer-Text-Format
*.atlas linguist-language=Protocol-Buffer-Text-Format
*.camera linguist-language=Protocol-Buffer-Text-Format
*.collection linguist-language=Protocol-Buffer-Text-Format
*.collectionfactory linguist-language=Protocol-Buffer-Text-Format
*.collectionproxy linguist-language=Protocol-Buffer-Text-Format
*.collisionobject linguist-language=Protocol-Buffer-Text-Format
*.cubemap linguist-language=Protocol-Buffer-Text-Format
*.display_profiles linguist-language=Protocol-Buffer-Text-Format
*.factory linguist-language=Protocol-Buffer-Text-Format
*.font linguist-language=Protocol-Buffer-Text-Format
*.gamepads linguist-language=Protocol-Buffer-Text-Format
*.go linguist-language=Protocol-Buffer-Text-Format
*.gui linguist-language=Protocol-Buffer-Text-Format
*.input_binding linguist-language=Protocol-Buffer-Text-Format
*.label linguist-language=Protocol-Buffer-Text-Format
*.material linguist-language=Protocol-Buffer-Text-Format
*.mesh linguist-language=Protocol-Buffer-Text-Format
*.model linguist-language=Protocol-Buffer-Text-Format
*.particlefx linguist-language=Protocol-Buffer-Text-Format
*.render linguist-language=Protocol-Buffer-Text-Format
*.sound linguist-language=Protocol-Buffer-Text-Format
*.sprite linguist-language=Protocol-Buffer-Text-Format
*.spinemodel linguist-language=Protocol-Buffer-Text-Format
*.spinescene linguist-language=Protocol-Buffer-Text-Format
*.texture_profiles linguist-language=Protocol-Buffer-Text-Format
*.tilemap linguist-language=Protocol-Buffer-Text-Format
*.tilesource linguist-language=Protocol-Buffer-Text-Format

# Defold YAML Files
*.appmanifest linguist-language=YAML
*.manifest linguist-language=YAML
*.script_api linguist-language=YAML

# Defold JSON Files
*.buffer linguist-language=JSON
Expand Down
6 changes: 4 additions & 2 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ The alpha channel is automatically released for every successful push to dev.
$ git merge dev
$ git push

Beta beta channel is automatically released for every successful push to beta.
Beta channel is automatically released for every successful push to beta.

1. Collect release notes using `python scripts/releasenotes_git.py` and post on [forum.defold.com](https://forum.defold.com/c/releasenotes)
1. Collect release notes using `python scripts/releasenotes_github_projectv2.py` and post on [forum.defold.com](https://forum.defold.com/c/releasenotes)
and add the "BETA" tag to the headline

* Note: The release notes script requires a github access token to work correctly (https://github.com/settings/tokens). If the token is incorrect, you will likely get an error saying 'Unable to find GitHub project for version x.x.x'. Create a "classic" github token and add permissions to read projects. If the script still fails, you might need more permissions.

### Update private repos

1. Also update the beta for the console platforms
Expand Down
5 changes: 3 additions & 2 deletions build_tools/s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,11 @@ def move_release(archive_path, sha1, channel):
continue

# copy the file to the new location
print("Copy object: %s -> %s" % (obj.key, new_key))
print("Create redirection %s to %s\n" % (obj.key, new_redirect))
new_object = bucket.Object(new_key)
new_redirect = "http://%s/%s" % (bucket_name, new_key)

print("Copy object: %s -> %s" % (obj.key, new_key))
print("Create redirection %s to %s\n" % (obj.key, new_redirect))
new_object.copy_from(
CopySource={'Bucket': bucket_name, 'Key': obj.key}
)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
// Copyright 2020-2024 The Defold Foundation
// Copyright 2014-2020 King
// Copyright 2009-2014 Ragnar Svensson, Christian Murray
// Licensed under the Defold License version 1.0 (the "License"); you may not use
// this file except in compliance with the License.
//
// You may obtain a copy of the License, together with FAQs at
// https://www.defold.com/license
//
// 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 com.defold.extension.pipeline;

import java.io.File;
import java.util.List;
import java.util.Objects;

/**
* Implement this interface in com.defold.extension.pipeline package with no-argument constructor
* to add support for transpiling a language to Lua that is then will be used during the build
*/
public interface ILuaTranspiler {

/**
* @return A resource path to a build file, i.e. a file that configures the transpiler;
* a project-relative path starting with slash, e.g. {@code "/tlconfig.lua"}
*/
String getBuildFileResourcePath();

/**
* @return A file extension for the source code files of the transpiled language,
* e.g. {@code "ext"}
*/
String getSourceExt();

/**
* Build the project from the source dir to output dir
*
* @param pluginDir a build plugins dir inside the project root that contains unpacked plugins
* from all project extensions, useful for distributing and using transpiler
* binaries. When directory is a native extension (i.e. has {@code "ext.manifest"}
* file), even if it comes from a dependency, files from
* {@code "${ext-dir}/plugins/bin/${platform}/"} (or {@code "${ext-dir}/plugins/bin/${platform}.zip"})
* will be extracted to the plugin dir, and then may be subsequently accessed (and
* executed) using this path, e.g. with {@code new File(pluginDir, "my-transpiler-lib/plugins/bin/"
* + Platform.getHostPlatform().getPair() + "/my-transpiler.exe")}
* @param sourceDir a dir that is guaranteed to have all the source code files as reported
* by {@link #getSourceExt()}, and a build file, as reported by
* {@link #getBuildFileResourcePath()}. This might be a real project dir,
* or it could be a temporary directory if some sources are coming from
* the dependency zip files.
* @param outputDir a dir to put the transpiled lua files to. All lua files from the
* directory will be compiled as a part of the project compilation. The
* directory is preserved over editor/bob transpiler runs and editor restarts,
* so it's a responsibility of the transpiler to clear out unneeded files from
* previous runs
* @return a possibly empty (but not nullable!) list of build issues
*/
List<Issue> transpile(File pluginDir, File sourceDir, File outputDir) throws Exception;

final class Issue {
public final Severity severity;
public final String resourcePath;
public final int lineNumber;
public final String message;

/**
* @param severity issue severity
* @param resourcePath compiled resource path of the build file or some of the source
* files relative to project root, must start with slash
* @param lineNumber 1-indexed line number
* @param message issue message to present to the user
*/
public Issue(Severity severity, String resourcePath, int lineNumber, String message) {
if (severity == null) {
throw new IllegalArgumentException("Issue severity must not be null");
}
if (resourcePath == null || resourcePath.isEmpty() || resourcePath.charAt(0) != '/') {
throw new IllegalArgumentException("Invalid issue resource path: " + resourcePath);
}
if (lineNumber <= 0) {
throw new IllegalArgumentException("Invalid issue line number: " + lineNumber);
}
if (message == null || message.isEmpty()) {
throw new IllegalArgumentException("Invalid issue message: " + message);
}
this.severity = severity;
this.resourcePath = resourcePath;
this.lineNumber = lineNumber;
this.message = message;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Issue issue = (Issue) o;
return lineNumber == issue.lineNumber && severity == issue.severity && Objects.equals(resourcePath, issue.resourcePath) && Objects.equals(message, issue.message);
}

@Override
public int hashCode() {
return Objects.hash(severity, resourcePath, lineNumber, message);
}

@Override
public String toString() {
return "Issue{" +
"severity=" + severity +
", resourcePath='" + resourcePath + '\'' +
", lineNumber=" + lineNumber +
", message='" + message + '\'' +
'}';
}
}

enum Severity {INFO, WARNING, ERROR}
}

0 comments on commit 0325f41

Please sign in to comment.