Skip to content

Commit

Permalink
Fix conversion of platforms for 'Internal' annotation
Browse files Browse the repository at this point in the history
The conversion of platforms for 'Internal' annotation was invalid
when they were specified without quotation marks. In such a case
the converter set internal visibility for all platforms.

This change adjusts the converter as well as the output of smoke
tests to show that the behavior is correct now.

Signed-off-by: Patryk Wrobel <[email protected]>
  • Loading branch information
pwrobeldev committed Nov 5, 2024
1 parent 2513cdd commit fe43f73
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Unreleased:
### Bug fixes:
* Fixed conversion of platforms for 'Internal' annotation to work correctly also when arguments are not in quotation marks.
* Dart: generate omitted documentation of properties.

## 13.9.6
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2016-2022 HERE Europe B.V.
# Copyright (C) 2016-2024 HERE Europe B.V.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import com.example.NativeBase;

final class DartInternalClassRev extends NativeBase {
public final class DartInternalClassRev extends NativeBase {

/**
* For internal use only.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import com.example.NativeBase;

final class SwiftInternalClassRev extends NativeBase {
public final class SwiftInternalClassRev extends NativeBase {

/**
* For internal use only.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@


export 'src/smoke/dart_internal_elements.dart' show DartInternalElements;
export 'src/smoke/dart_internal_elements_enabled.dart' show DartInternalElementsEnabled;
export 'src/smoke/dart_internal_elements_rev.dart' show DartInternalElementsRev;
Expand All @@ -8,4 +10,7 @@ export 'src/smoke/dart_public_elements.dart' show DartPublicElements;
export 'src/smoke/dart_public_elements_enabled.dart' show DartPublicElementsEnabled;
export 'src/smoke/dart_public_elements_skipped.dart' show DartPublicElementsSkipped;
export 'src/smoke/java_internal_class.dart' show JavaInternalClass;
export 'src/smoke/java_internal_class_rev.dart' show JavaInternalClassRev;
export 'src/smoke/java_swift_internal_class.dart' show JavaSwiftInternalClass;
export 'src/smoke/swift_internal_class.dart' show SwiftInternalClass;
export 'src/smoke/swift_internal_class_rev.dart' show SwiftInternalClassRev;
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import Foundation

internal class DartInternalClassRev {
public class DartInternalClassRev {


let c_instance : _baseRef
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import Foundation

internal class JavaInternalClassRev {
public class JavaInternalClassRev {


let c_instance : _baseRef
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2016-2020 HERE Europe B.V.
* Copyright (C) 2016-2024 HERE Europe B.V.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -178,7 +178,12 @@ internal object AntlrLimeConverter {
attributes: LimeAttributes.Builder,
valueContext: LimeParser.AnnotationValueContext,
) {
val value = convertAnnotationValue(valueContext)
val value =
when {
valueContext.simpleId() != null -> valueContext.simpleId().text
else -> convertAnnotationValue(valueContext)
}

if (value == true) {
attributes.addAttribute(LimeAttributeType.INTERNAL)
return
Expand Down

0 comments on commit fe43f73

Please sign in to comment.