Skip to content

Commit

Permalink
chore(samples): update build
Browse files Browse the repository at this point in the history
  • Loading branch information
matkoch committed May 30, 2024
1 parent 6d38414 commit c4117b1
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 24 deletions.
6 changes: 3 additions & 3 deletions samples/CefToolWindow/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import org.apache.tools.ant.taskdefs.condition.Os

plugins {
id 'java'
id 'org.jetbrains.kotlin.jvm' version '1.9.21'
id 'org.jetbrains.intellij' version '1.16.1' // See https://github.com/JetBrains/gradle-intellij-plugin/releases
id 'com.jetbrains.rdgen' version '2023.3.2' // See https://github.com/JetBrains/rd/releases
id 'org.jetbrains.kotlin.jvm' version '2.0.0'
id 'org.jetbrains.intellij' version '1.17.3' // See https://github.com/JetBrains/gradle-intellij-plugin/releases
id 'com.jetbrains.rdgen' version '2024.1.1' // See https://github.com/JetBrains/rd/releases
id 'me.filippov.gradle.jvm.wrapper' version '0.14.0'
}

Expand Down
2 changes: 1 addition & 1 deletion samples/CefToolWindow/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ PublishToken="_PLACEHOLDER_"
# Release: 2020.2
# EAP: 2020.3-EAP2-SNAPSHOT
# Nightly: 2020.3-SNAPSHOT
ProductVersion=2023.3
ProductVersion=2024.1

# Kotlin 1.4 will bundle the stdlib dependency by default, causing problems with the version bundled with the IDE
# https://blog.jetbrains.com/kotlin/2020/07/kotlin-1-4-rc-released/#stdlib-default
Expand Down
2 changes: 1 addition & 1 deletion samples/CefToolWindow/src/dotnet/Plugin.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<!-- See https://www.nuget.org/packages/JetBrains.ReSharper.SDK -->
<!-- Keep in sync with ProductVersion in gradle.properties -->
<SdkVersion>2023.3.0</SdkVersion>
<SdkVersion>2024.1.0</SdkVersion>

<Title>CefToolWindow</Title>
<Description>Description</Description>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a RdGen v1.10.
// This code was generated by a RdGen v1.12.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
Expand Down Expand Up @@ -38,7 +38,7 @@ namespace JetBrains.Rider.Model
/// <summary>
/// <p>Generated from: CefToolWindowModel.kt:12</p>
/// </summary>
[JetBrains.Application.ShellComponent]
[JetBrains.Application.ShellComponent(Application.Parts.Instantiation.DemandAnyThread)]
public class CefToolWindowModel : RdExtBase
{
//fields
Expand Down Expand Up @@ -89,7 +89,7 @@ public static void RegisterDeclaredTypesSerializers(ISerializers serializers)
public CefToolWindowModel(Lifetime lifetime, IProtocol protocol) : this()
{
Identify(protocol.Identities, RdId.Root.Mix("CefToolWindowModel"));
Bind(lifetime, protocol, "CefToolWindowModel");
this.BindTopLevel(lifetime, protocol, "CefToolWindowModel");
}

//constants
Expand Down Expand Up @@ -152,7 +152,8 @@ private BeCefToolWindowPanel(
[NotNull] RdProperty<bool> enabled,
[NotNull] RdProperty<string> controlId,
[NotNull] RdProperty<int> uniqueId,
[NotNull] RdProperty<string> dataId,
[NotNull] RdProperty<int> dataId,
[NotNull] RdProperty<bool> focusable,
[NotNull] RdProperty<string> tooltip,
[NotNull] RdSignal<Unit> focus,
[NotNull] RdProperty<JetBrains.Rider.Model.UIAutomation.ControlVisibility> visible
Expand All @@ -161,6 +162,7 @@ [NotNull] RdProperty<JetBrains.Rider.Model.UIAutomation.ControlVisibility> visib
controlId,
uniqueId,
dataId,
focusable,
tooltip,
focus,
visible
Expand Down Expand Up @@ -203,7 +205,8 @@ [CanBeNull] string html
new RdProperty<bool>(JetBrains.Rd.Impl.Serializers.ReadBool, JetBrains.Rd.Impl.Serializers.WriteBool, true),
new RdProperty<string>(JetBrains.Rd.Impl.Serializers.ReadString, JetBrains.Rd.Impl.Serializers.WriteString, ""),
new RdProperty<int>(JetBrains.Rd.Impl.Serializers.ReadInt, JetBrains.Rd.Impl.Serializers.WriteInt),
new RdProperty<string>(JetBrains.Rd.Impl.Serializers.ReadString, JetBrains.Rd.Impl.Serializers.WriteString, ""),
new RdProperty<int>(JetBrains.Rd.Impl.Serializers.ReadInt, JetBrains.Rd.Impl.Serializers.WriteInt),
new RdProperty<bool>(JetBrains.Rd.Impl.Serializers.ReadBool, JetBrains.Rd.Impl.Serializers.WriteBool),
new RdProperty<string>(ReadStringNullable, WriteStringNullable),
new RdSignal<Unit>(JetBrains.Rd.Impl.Serializers.ReadVoid, JetBrains.Rd.Impl.Serializers.WriteVoid),
new RdProperty<JetBrains.Rider.Model.UIAutomation.ControlVisibility>(ReadControlVisibility, WriteControlVisibility)
Expand All @@ -217,7 +220,8 @@ [CanBeNull] string html
var enabled = RdProperty<bool>.Read(ctx, reader, JetBrains.Rd.Impl.Serializers.ReadBool, JetBrains.Rd.Impl.Serializers.WriteBool);
var controlId = RdProperty<string>.Read(ctx, reader, JetBrains.Rd.Impl.Serializers.ReadString, JetBrains.Rd.Impl.Serializers.WriteString);
var uniqueId = RdProperty<int>.Read(ctx, reader, JetBrains.Rd.Impl.Serializers.ReadInt, JetBrains.Rd.Impl.Serializers.WriteInt);
var dataId = RdProperty<string>.Read(ctx, reader, JetBrains.Rd.Impl.Serializers.ReadString, JetBrains.Rd.Impl.Serializers.WriteString);
var dataId = RdProperty<int>.Read(ctx, reader, JetBrains.Rd.Impl.Serializers.ReadInt, JetBrains.Rd.Impl.Serializers.WriteInt);
var focusable = RdProperty<bool>.Read(ctx, reader, JetBrains.Rd.Impl.Serializers.ReadBool, JetBrains.Rd.Impl.Serializers.WriteBool);
var tooltip = RdProperty<string>.Read(ctx, reader, ReadStringNullable, WriteStringNullable);
var focus = RdSignal<Unit>.Read(ctx, reader, JetBrains.Rd.Impl.Serializers.ReadVoid, JetBrains.Rd.Impl.Serializers.WriteVoid);
var visible = RdProperty<JetBrains.Rider.Model.UIAutomation.ControlVisibility>.Read(ctx, reader, ReadControlVisibility, WriteControlVisibility);
Expand All @@ -228,7 +232,7 @@ [CanBeNull] string html
var getResource = RdCall<string, byte[]>.Read(ctx, reader, JetBrains.Rd.Impl.Serializers.ReadString, JetBrains.Rd.Impl.Serializers.WriteString, JetBrains.Rd.Impl.Serializers.ReadByteArray, JetBrains.Rd.Impl.Serializers.WriteByteArray);
var sendMessage = RdCall<string, Unit>.Read(ctx, reader, JetBrains.Rd.Impl.Serializers.ReadString, JetBrains.Rd.Impl.Serializers.WriteString, JetBrains.Rd.Impl.Serializers.ReadVoid, JetBrains.Rd.Impl.Serializers.WriteVoid);
var messageReceived = RdSignal<string>.Read(ctx, reader, JetBrains.Rd.Impl.Serializers.ReadString, JetBrains.Rd.Impl.Serializers.WriteString);
var _result = new BeCefToolWindowPanel(url, html, openDevTools, openUrl, getResource, sendMessage, messageReceived, enabled, controlId, uniqueId, dataId, tooltip, focus, visible).WithId(_id);
var _result = new BeCefToolWindowPanel(url, html, openDevTools, openUrl, getResource, sendMessage, messageReceived, enabled, controlId, uniqueId, dataId, focusable, tooltip, focus, visible).WithId(_id);
return _result;
};
public static CtxReadDelegate<string> ReadStringNullable = JetBrains.Rd.Impl.Serializers.ReadString.NullableClass();
Expand All @@ -240,7 +244,8 @@ [CanBeNull] string html
RdProperty<bool>.Write(ctx, writer, value._Enabled);
RdProperty<string>.Write(ctx, writer, value._ControlId);
RdProperty<int>.Write(ctx, writer, value._UniqueId);
RdProperty<string>.Write(ctx, writer, value._DataId);
RdProperty<int>.Write(ctx, writer, value._DataId);
RdProperty<bool>.Write(ctx, writer, value._Focusable);
RdProperty<string>.Write(ctx, writer, value._Tooltip);
RdSignal<Unit>.Write(ctx, writer, value._Focus);
RdProperty<JetBrains.Rider.Model.UIAutomation.ControlVisibility>.Write(ctx, writer, value._Visible);
Expand Down Expand Up @@ -277,6 +282,7 @@ public override void Print(PrettyPrinter printer)
printer.Print("controlId = "); _ControlId.PrintEx(printer); printer.Println();
printer.Print("uniqueId = "); _UniqueId.PrintEx(printer); printer.Println();
printer.Print("dataId = "); _DataId.PrintEx(printer); printer.Println();
printer.Print("focusable = "); _Focusable.PrintEx(printer); printer.Println();
printer.Print("tooltip = "); _Tooltip.PrintEx(printer); printer.Println();
printer.Print("focus = "); _Focus.PrintEx(printer); printer.Println();
printer.Print("visible = "); _Visible.PrintEx(printer); printer.Println();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using JetBrains.Application.UI.ToolWindowManagement;
using JetBrains.Application.UI.UIAutomation;
using JetBrains.Lifetimes;
using JetBrains.ProjectModel;
using JetBrains.Rider.Model;
Expand Down Expand Up @@ -32,11 +31,7 @@ private void InitToolWindow()
_myToolWindowClass.RegisterInstance(_myLifetime,
title: null,
icon: null,
(lifetime, _) =>
{
var model = _mySolution.GetComponent<CefToolWindowModel>();
return EitherControl.FromAutomation(lifetime, model.ToolWindowContent.Value);
});
(_, _) => _mySolution.GetComponent<CefToolWindowModel>().ToolWindowContent.Value);
}

public void ShowToolWindow()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ class CefToolWindowModel private constructor(
)
}
//contexts
//threading
override val extThreading: ExtThreadingKind get() = ExtThreadingKind.Default
}
val IProtocol.cefToolWindowModel get() = getOrCreateExtension(CefToolWindowModel::class) { @Suppress("DEPRECATION") CefToolWindowModel.create(lifetime, this) }

Expand All @@ -113,7 +115,8 @@ class BeCefToolWindowPanel private constructor(
_enabled: RdProperty<Boolean>,
_controlId: RdProperty<@org.jetbrains.annotations.NonNls String>,
_uniqueId: RdOptionalProperty<Int>,
_dataId: RdProperty<String>,
_dataId: RdOptionalProperty<Int>,
_focusable: RdOptionalProperty<Boolean>,
_tooltip: RdProperty<@org.jetbrains.annotations.Nls String?>,
_focus: RdSignal<Unit>,
_visible: RdOptionalProperty<com.jetbrains.ide.model.uiautomation.ControlVisibility>
Expand All @@ -122,6 +125,7 @@ class BeCefToolWindowPanel private constructor(
_controlId,
_uniqueId,
_dataId,
_focusable,
_tooltip,
_focus,
_visible
Expand All @@ -137,7 +141,8 @@ class BeCefToolWindowPanel private constructor(
val _enabled = RdProperty.read(ctx, buffer, FrameworkMarshallers.Bool)
val _controlId = RdProperty.read(ctx, buffer, __StringSerializer)
val _uniqueId = RdOptionalProperty.read(ctx, buffer, FrameworkMarshallers.Int)
val _dataId = RdProperty.read(ctx, buffer, FrameworkMarshallers.String)
val _dataId = RdOptionalProperty.read(ctx, buffer, FrameworkMarshallers.Int)
val _focusable = RdOptionalProperty.read(ctx, buffer, FrameworkMarshallers.Bool)
val _tooltip = RdProperty.read(ctx, buffer, __StringNullableSerializer)
val _focus = RdSignal.read(ctx, buffer, FrameworkMarshallers.Void)
val _visible = RdOptionalProperty.read(ctx, buffer, com.jetbrains.ide.model.uiautomation.ControlVisibility.marshaller)
Expand All @@ -148,15 +153,16 @@ class BeCefToolWindowPanel private constructor(
val _getResource = RdCall.read(ctx, buffer, FrameworkMarshallers.String, FrameworkMarshallers.ByteArray)
val _sendMessage = RdCall.read(ctx, buffer, FrameworkMarshallers.String, FrameworkMarshallers.Void)
val _messageReceived = RdSignal.read(ctx, buffer, FrameworkMarshallers.String)
return BeCefToolWindowPanel(url, html, _openDevTools, _openUrl, _getResource, _sendMessage, _messageReceived, _enabled, _controlId, _uniqueId, _dataId, _tooltip, _focus, _visible).withId(_id)
return BeCefToolWindowPanel(url, html, _openDevTools, _openUrl, _getResource, _sendMessage, _messageReceived, _enabled, _controlId, _uniqueId, _dataId, _focusable, _tooltip, _focus, _visible).withId(_id)
}

override fun write(ctx: SerializationCtx, buffer: AbstractBuffer, value: BeCefToolWindowPanel) {
value.rdid.write(buffer)
RdProperty.write(ctx, buffer, value._enabled)
RdProperty.write(ctx, buffer, value._controlId)
RdOptionalProperty.write(ctx, buffer, value._uniqueId)
RdProperty.write(ctx, buffer, value._dataId)
RdOptionalProperty.write(ctx, buffer, value._dataId)
RdOptionalProperty.write(ctx, buffer, value._focusable)
RdProperty.write(ctx, buffer, value._tooltip)
RdSignal.write(ctx, buffer, value._focus)
RdOptionalProperty.write(ctx, buffer, value._visible)
Expand Down Expand Up @@ -210,7 +216,8 @@ class BeCefToolWindowPanel private constructor(
RdProperty<Boolean>(true, FrameworkMarshallers.Bool),
RdProperty<@org.jetbrains.annotations.NonNls String>("", __StringSerializer),
RdOptionalProperty<Int>(FrameworkMarshallers.Int),
RdProperty<String>("", FrameworkMarshallers.String),
RdOptionalProperty<Int>(FrameworkMarshallers.Int),
RdOptionalProperty<Boolean>(FrameworkMarshallers.Bool),
RdProperty<@org.jetbrains.annotations.Nls String?>(null, __StringNullableSerializer),
RdSignal<Unit>(FrameworkMarshallers.Void),
RdOptionalProperty<com.jetbrains.ide.model.uiautomation.ControlVisibility>(com.jetbrains.ide.model.uiautomation.ControlVisibility.marshaller)
Expand All @@ -233,6 +240,7 @@ class BeCefToolWindowPanel private constructor(
print("controlId = "); _controlId.print(printer); println()
print("uniqueId = "); _uniqueId.print(printer); println()
print("dataId = "); _dataId.print(printer); println()
print("focusable = "); _focusable.print(printer); println()
print("tooltip = "); _tooltip.print(printer); println()
print("focus = "); _focus.print(printer); println()
print("visible = "); _visible.print(printer); println()
Expand All @@ -253,10 +261,12 @@ class BeCefToolWindowPanel private constructor(
_controlId.deepClonePolymorphic(),
_uniqueId.deepClonePolymorphic(),
_dataId.deepClonePolymorphic(),
_focusable.deepClonePolymorphic(),
_tooltip.deepClonePolymorphic(),
_focus.deepClonePolymorphic(),
_visible.deepClonePolymorphic()
)
}
//contexts
//threading
}

0 comments on commit c4117b1

Please sign in to comment.