Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ad6b44aa authored by Yang Ni's avatar Yang Ni
Browse files

Add a name to ScriptGroup2.Builder.create method

The name is not used in any meaningful way yet, but would be used
to name the file for generated code for fused kernels in other
coming CLs.

A script group name cannot be null or empty, or longer than 100
characters. It can only contain letters, digits, '-', or '_'.

Change-Id: I95fdbf58e6689da91ca98c2057dfa1a803d3b27b
parent d1af38a4
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -412,7 +412,11 @@ public class ScriptGroup2 extends BaseObj {
            return addInvoke(invoke, args.toArray(), bindingMap);
        }

        public ScriptGroup2 create(Future... outputs) {
        public ScriptGroup2 create(String name, Future... outputs) {
            if (name == null || name.isEmpty() || name.length() > 100 ||
                !name.equals(name.replaceAll("[^a-zA-Z0-9-]", "_"))) {
                throw new RSIllegalArgumentException("invalid script group name");
            }
            ScriptGroup2 ret = new ScriptGroup2(mRS, mClosures, mInputs, outputs);
            return ret;
        }