From ddfe5d925b479747e4d2b3a12631b46a8df990f6 Mon Sep 17 00:00:00 2001 From: Roberto Lublinerman Date: Mon, 9 Dec 2024 09:32:06 -0800 Subject: [PATCH] [javac] Exclude dummy J2ktMonitor.java from j2kt builds. J2ktMonitor is only present in the j2kt standard library, so it needs to be provided for the rest of the readables but excluded from the j2kt readables. PiperOrigin-RevId: 704315905 --- .../readable/java/synchronizedstatement/BUILD | 13 +++++++++ .../lang/J2ktMonitor+J2ObjCCompat.h.txt | 11 -------- .../javaemul/lang/J2ktMonitor.kt.txt | 28 ------------------- 3 files changed, 13 insertions(+), 39 deletions(-) delete mode 100644 transpiler/javatests/com/google/j2cl/readable/java/synchronizedstatement/output_kt/javaemul/lang/J2ktMonitor+J2ObjCCompat.h.txt delete mode 100644 transpiler/javatests/com/google/j2cl/readable/java/synchronizedstatement/output_kt/javaemul/lang/J2ktMonitor.kt.txt diff --git a/transpiler/javatests/com/google/j2cl/readable/java/synchronizedstatement/BUILD b/transpiler/javatests/com/google/j2cl/readable/java/synchronizedstatement/BUILD index 888ae9ad29..a8c7c53214 100644 --- a/transpiler/javatests/com/google/j2cl/readable/java/synchronizedstatement/BUILD +++ b/transpiler/javatests/com/google/j2cl/readable/java/synchronizedstatement/BUILD @@ -1,3 +1,4 @@ +load("//build_defs:rules.bzl", "j2kt_jvm_library") load( "//transpiler/javatests/com/google/j2cl/readable:readable_example.bzl", "readable_example", @@ -8,6 +9,18 @@ package( licenses = ["notice"], ) +# Exclude J2ktMonitor.java from the readable example because it is part of the J2kt library. +j2kt_jvm_library( + name = "readable-j2kt-jvm", + srcs = glob( + ["*.java"], + exclude = ["J2ktMonitor.java"], + ), + deps = [ + "//jre/java:javaemul_internal_annotations-j2kt-jvm", + ], +) + readable_example( srcs = glob(["*.java"]), deps = ["//jre/java:javaemul_internal_annotations-j2cl"], diff --git a/transpiler/javatests/com/google/j2cl/readable/java/synchronizedstatement/output_kt/javaemul/lang/J2ktMonitor+J2ObjCCompat.h.txt b/transpiler/javatests/com/google/j2cl/readable/java/synchronizedstatement/output_kt/javaemul/lang/J2ktMonitor+J2ObjCCompat.h.txt deleted file mode 100644 index e1d33f8203..0000000000 --- a/transpiler/javatests/com/google/j2cl/readable/java/synchronizedstatement/output_kt/javaemul/lang/J2ktMonitor+J2ObjCCompat.h.txt +++ /dev/null @@ -1,11 +0,0 @@ -// Generated by J2KT from "javaemul/lang/J2ktMonitor.java" - -#import - -@class J2ktJavaemulLangJ2ktMonitor; - -NS_ASSUME_NONNULL_BEGIN - -@compatibility_alias JavaemulLangJ2ktMonitor J2ktJavaemulLangJ2ktMonitor; - -NS_ASSUME_NONNULL_END diff --git a/transpiler/javatests/com/google/j2cl/readable/java/synchronizedstatement/output_kt/javaemul/lang/J2ktMonitor.kt.txt b/transpiler/javatests/com/google/j2cl/readable/java/synchronizedstatement/output_kt/javaemul/lang/J2ktMonitor.kt.txt deleted file mode 100644 index 8d2532680f..0000000000 --- a/transpiler/javatests/com/google/j2cl/readable/java/synchronizedstatement/output_kt/javaemul/lang/J2ktMonitor.kt.txt +++ /dev/null @@ -1,28 +0,0 @@ -// Generated from "javaemul/lang/J2ktMonitor.java" -@file:OptIn(ExperimentalObjCName::class) -@file:Suppress( - "ALWAYS_NULL", - "PARAMETER_NAME_CHANGED_ON_OVERRIDE", - "SENSELESS_COMPARISON", - "UNCHECKED_CAST", - "UNNECESSARY_LATEINIT", - "UNNECESSARY_NOT_NULL_ASSERTION", - "UNREACHABLE_CODE", - "UNUSED_ANONYMOUS_PARAMETER", - "UNUSED_PARAMETER", - "UNUSED_VARIABLE", - "USELESS_CAST", - "VARIABLE_IN_SINGLETON_WITHOUT_THREAD_LOCAL", - "VARIABLE_WITH_REDUNDANT_INITIALIZER", - "REDUNDANT_ELSE_IN_WHEN") - -package javaemul.lang - -import javaemul.lang.* -import kotlin.OptIn -import kotlin.Suppress -import kotlin.experimental.ExperimentalObjCName -import kotlin.native.ObjCName - -@ObjCName("J2ktJavaemulLangJ2ktMonitor", exact = true) -open class J2ktMonitor {}