From ba5f22cd21ce7781b916a979e31a123043963264 Mon Sep 17 00:00:00 2001 From: Jason LeBrun Date: Tue, 5 Jan 2021 14:02:04 -0800 Subject: [PATCH] WIP: Add @Generated PiperOrigin-RevId: 350214577 --- src/tools/schema2kotlin.ts | 3 +++ third_party/java/arcs/build_defs/internal/kotlin.bzl | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/tools/schema2kotlin.ts b/src/tools/schema2kotlin.ts index 86f62cf8ff8..d64a8fb8e2b 100755 --- a/src/tools/schema2kotlin.ts +++ b/src/tools/schema2kotlin.ts @@ -57,6 +57,7 @@ export class Schema2Kotlin extends Schema2Base { 'import arcs.sdk.ArcsInstant', 'import arcs.sdk.BigInt', 'import arcs.sdk.toBigInt', + 'import javax.annotation.Generated', ); } imports.sort(); @@ -182,6 +183,8 @@ ${imports.join('\n')} return ` ${typeAliases.join(`\n`)} +${this.opts.wasm ? '' : '@Generated'} + abstract class Abstract${particle.name} : ${this.opts.wasm ? 'WasmParticleImpl' : 'arcs.sdk.BaseParticle'}() { ${this.opts.wasm ? '' : 'override '}val handles: Handles = Handles(${this.opts.wasm ? 'this' : ''}) diff --git a/third_party/java/arcs/build_defs/internal/kotlin.bzl b/third_party/java/arcs/build_defs/internal/kotlin.bzl index 080d0566d1c..4f1c9254155 100644 --- a/third_party/java/arcs/build_defs/internal/kotlin.bzl +++ b/third_party/java/arcs/build_defs/internal/kotlin.bzl @@ -585,7 +585,7 @@ def arcs_kt_plan( srcs = outs, platforms = platforms, visibility = visibility, - deps = arcs_sdk_deps + deps, + deps = arcs_sdk_deps + deps + ["//third_party/java/jsr250_annotations"], ) return {"outs": outs, "deps": arcs_sdk_deps} @@ -634,7 +634,7 @@ def arcs_kt_plan_2(name, package, arcs_sdk_deps, srcs = [], deps = [], visibilit srcs = plans, platforms = ["jvm"], visibility = visibility, - deps = arcs_sdk_deps + deps, + deps = arcs_sdk_deps + deps + ["//third_party/java/jsr250_annotations"], ) def arcs_kt_schema( @@ -712,7 +712,7 @@ def arcs_kt_schema( name = name, srcs = outs, platforms = platforms, - deps = arcs_sdk_deps, + deps = arcs_sdk_deps + ["//third_party/java/jsr250_annotations"], visibility = visibility, ) outdeps = outdeps + arcs_sdk_deps @@ -817,7 +817,7 @@ def arcs_kt_gen( name = name, srcs = depset(schema["outs"] + plan["outs"]).to_list(), platforms = platforms, - deps = depset(schema["deps"] + plan["deps"] + manifest_only(deps, inverse = True)).to_list(), + deps = depset(schema["deps"] + plan["deps"] + manifest_only(deps, inverse = True)).to_list() + ["//third_party/java/jsr250_annotations"], visibility = visibility, )