Skip to content

Commit

Permalink
Import dart:io in generated code, required for file descriptors
Browse files Browse the repository at this point in the history
  • Loading branch information
robert-ancell committed Nov 16, 2023
1 parent bc296c2 commit 3bd1baf
Show file tree
Hide file tree
Showing 34 changed files with 36 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/src/dbus_code_generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class DBusCodeGenerator {
var source = '';

source += _generateHeader();
source += "import 'dart:io';\n";
source += "import 'package:dbus/dbus.dart';\n";
source += '\n';
source += _generateRemoteObjectClass();
Expand All @@ -48,6 +49,7 @@ class DBusCodeGenerator {
var source = '';

source += _generateHeader();
source += "import 'dart:io';\n";
source += "import 'package:dbus/dbus.dart';\n";
source += '\n';
source += _generateObjectClass();
Expand Down
2 changes: 2 additions & 0 deletions test/dbus_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5747,6 +5747,7 @@ void main() {
equals('// This is great code.\n'
'// It is the best code.\n'
'\n'
'import \'dart:io\';\n'
'import \'package:dbus/dbus.dart\';\n'
'\n'
'class ComExampleObject extends DBusRemoteObject {\n'
Expand All @@ -5757,6 +5758,7 @@ void main() {
equals('// This is great code.\n'
'// It is the best code.\n'
'\n'
'import \'dart:io\';\n'
'import \'package:dbus/dbus.dart\';\n'
'\n'
'class ComExampleObject extends DBusObject {\n'
Expand Down
1 change: 1 addition & 0 deletions test/generated-code/method-multiple-inputs.client.out
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'dart:io';
import 'package:dbus/dbus.dart';

class ComExampleTest extends DBusRemoteObject {
Expand Down
1 change: 1 addition & 0 deletions test/generated-code/method-multiple-inputs.server.out
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'dart:io';
import 'package:dbus/dbus.dart';

class ComExampleTest extends DBusObject {
Expand Down
1 change: 1 addition & 0 deletions test/generated-code/method-multiple-outputs.client.out
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'dart:io';
import 'package:dbus/dbus.dart';

class ComExampleTest extends DBusRemoteObject {
Expand Down
1 change: 1 addition & 0 deletions test/generated-code/method-multiple-outputs.server.out
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'dart:io';
import 'package:dbus/dbus.dart';

class ComExampleTest extends DBusObject {
Expand Down
1 change: 1 addition & 0 deletions test/generated-code/method-no-args.client.out
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'dart:io';
import 'package:dbus/dbus.dart';

class ComExampleTest extends DBusRemoteObject {
Expand Down
1 change: 1 addition & 0 deletions test/generated-code/method-no-args.server.out
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'dart:io';
import 'package:dbus/dbus.dart';

class ComExampleTest extends DBusObject {
Expand Down
1 change: 1 addition & 0 deletions test/generated-code/method-no-reply.client.out
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'dart:io';
import 'package:dbus/dbus.dart';

class ComExampleTest extends DBusRemoteObject {
Expand Down
1 change: 1 addition & 0 deletions test/generated-code/method-no-reply.server.out
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'dart:io';
import 'package:dbus/dbus.dart';

class ComExampleTest extends DBusObject {
Expand Down
1 change: 1 addition & 0 deletions test/generated-code/method-single-input.client.out
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'dart:io';
import 'package:dbus/dbus.dart';

class ComExampleTest extends DBusRemoteObject {
Expand Down
1 change: 1 addition & 0 deletions test/generated-code/method-single-input.server.out
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'dart:io';
import 'package:dbus/dbus.dart';

class ComExampleTest extends DBusObject {
Expand Down
1 change: 1 addition & 0 deletions test/generated-code/method-single-output.client.out
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'dart:io';
import 'package:dbus/dbus.dart';

class ComExampleTest extends DBusRemoteObject {
Expand Down
1 change: 1 addition & 0 deletions test/generated-code/method-single-output.server.out
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'dart:io';
import 'package:dbus/dbus.dart';

class ComExampleTest extends DBusObject {
Expand Down
1 change: 1 addition & 0 deletions test/generated-code/method-unnamed-arg.client.out
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'dart:io';
import 'package:dbus/dbus.dart';

class ComExampleTest extends DBusRemoteObject {
Expand Down
1 change: 1 addition & 0 deletions test/generated-code/method-unnamed-arg.server.out
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'dart:io';
import 'package:dbus/dbus.dart';

class ComExampleTest extends DBusObject {
Expand Down
1 change: 1 addition & 0 deletions test/generated-code/methods.client.out
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'dart:io';
import 'package:dbus/dbus.dart';

class ComExampleTest extends DBusRemoteObject {
Expand Down
1 change: 1 addition & 0 deletions test/generated-code/methods.server.out
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'dart:io';
import 'package:dbus/dbus.dart';

class ComExampleTest extends DBusObject {
Expand Down
1 change: 1 addition & 0 deletions test/generated-code/multiple-interfaces.client.out
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'dart:io';
import 'package:dbus/dbus.dart';

class ComExampleTest1 extends DBusRemoteObject {
Expand Down
1 change: 1 addition & 0 deletions test/generated-code/multiple-interfaces.server.out
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'dart:io';
import 'package:dbus/dbus.dart';

class ComExampleTest1 extends DBusObject {
Expand Down
1 change: 1 addition & 0 deletions test/generated-code/properties.client.out
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'dart:io';
import 'package:dbus/dbus.dart';

class ComExampleTest extends DBusRemoteObject {
Expand Down
1 change: 1 addition & 0 deletions test/generated-code/properties.server.out
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'dart:io';
import 'package:dbus/dbus.dart';

class ComExampleTest extends DBusObject {
Expand Down
1 change: 1 addition & 0 deletions test/generated-code/property-access.client.out
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'dart:io';
import 'package:dbus/dbus.dart';

class ComExampleTest extends DBusRemoteObject {
Expand Down
1 change: 1 addition & 0 deletions test/generated-code/property-access.server.out
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'dart:io';
import 'package:dbus/dbus.dart';

class ComExampleTest extends DBusObject {
Expand Down
1 change: 1 addition & 0 deletions test/generated-code/property.client.out
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'dart:io';
import 'package:dbus/dbus.dart';

class ComExampleTest extends DBusRemoteObject {
Expand Down
1 change: 1 addition & 0 deletions test/generated-code/property.server.out
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'dart:io';
import 'package:dbus/dbus.dart';

class ComExampleTest extends DBusObject {
Expand Down
1 change: 1 addition & 0 deletions test/generated-code/signal-multiple-args.client.out
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'dart:io';
import 'package:dbus/dbus.dart';

/// Signal data for com.example.Test.Event.
Expand Down
1 change: 1 addition & 0 deletions test/generated-code/signal-multiple-args.server.out
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'dart:io';
import 'package:dbus/dbus.dart';

class ComExampleTest extends DBusObject {
Expand Down
1 change: 1 addition & 0 deletions test/generated-code/signal-no-args.client.out
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'dart:io';
import 'package:dbus/dbus.dart';

/// Signal data for com.example.Test.Event.
Expand Down
1 change: 1 addition & 0 deletions test/generated-code/signal-no-args.server.out
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'dart:io';
import 'package:dbus/dbus.dart';

class ComExampleTest extends DBusObject {
Expand Down
1 change: 1 addition & 0 deletions test/generated-code/signal-single-arg.client.out
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'dart:io';
import 'package:dbus/dbus.dart';

/// Signal data for com.example.Test.Event.
Expand Down
1 change: 1 addition & 0 deletions test/generated-code/signal-single-arg.server.out
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'dart:io';
import 'package:dbus/dbus.dart';

class ComExampleTest extends DBusObject {
Expand Down
1 change: 1 addition & 0 deletions test/generated-code/signals.client.out
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'dart:io';
import 'package:dbus/dbus.dart';

/// Signal data for com.example.Test.Event1.
Expand Down
1 change: 1 addition & 0 deletions test/generated-code/signals.server.out
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'dart:io';
import 'package:dbus/dbus.dart';

class ComExampleTest extends DBusObject {
Expand Down

0 comments on commit 3bd1baf

Please sign in to comment.