Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions src/Commands/PluginCreateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ protected function createPluginStructure(): void
'/src/Facades',
'/src/Events',
'/src/Commands',
'/resources/android',
'/resources/ios',
'/resources/android/src',
'/resources/ios/Sources',
'/resources/js',
'/tests',
];
Expand Down Expand Up @@ -536,7 +536,7 @@ class GetStatus(private val context: Context) : BridgeFunction {
}
KOTLIN;

$this->files->put($path."/resources/android/{$namespace}Functions.kt", $content);
$this->files->put($path."/resources/android/src/{$namespace}Functions.kt", $content);
}

protected function createSwiftFunctions(string $path): void
Expand Down Expand Up @@ -573,7 +573,7 @@ class GetStatus: BridgeFunction {
}
SWIFT;

$this->files->put($path."/resources/ios/{$namespace}Functions.swift", $content);
$this->files->put($path."/resources/ios/Sources/{$namespace}Functions.swift", $content);
}

protected function createJavaScript(string $path): void
Expand Down Expand Up @@ -986,7 +986,7 @@ protected function createTests(string $path): void

describe('Native Code', function () {
it('has Android Kotlin file', function () {
\$kotlinFile = \$this->pluginPath . '/resources/android/{$namespace}Functions.kt';
\$kotlinFile = \$this->pluginPath . '/resources/android/src/{$namespace}Functions.kt';

expect(file_exists(\$kotlinFile))->toBeTrue();

Expand All @@ -997,7 +997,7 @@ protected function createTests(string $path): void
});

it('has iOS Swift file', function () {
\$swiftFile = \$this->pluginPath . '/resources/ios/{$namespace}Functions.swift';
\$swiftFile = \$this->pluginPath . '/resources/ios/Sources/{$namespace}Functions.swift';

expect(file_exists(\$swiftFile))->toBeTrue();

Expand All @@ -1009,8 +1009,8 @@ protected function createTests(string $path): void
it('has matching bridge function classes in native code', function () {
\$manifest = json_decode(file_get_contents(\$this->manifestPath), true);

\$kotlinFile = \$this->pluginPath . '/resources/android/{$namespace}Functions.kt';
\$swiftFile = \$this->pluginPath . '/resources/ios/{$namespace}Functions.swift';
\$kotlinFile = \$this->pluginPath . '/resources/android/src/{$namespace}Functions.kt';
\$swiftFile = \$this->pluginPath . '/resources/ios/Sources/{$namespace}Functions.swift';

\$kotlinContent = file_get_contents(\$kotlinFile);
\$swiftContent = file_get_contents(\$swiftFile);
Expand Down Expand Up @@ -1171,8 +1171,8 @@ protected function displayNextSteps(): void
$this->components->twoColumnDetail('Next steps', '');
$this->components->bulletList([
'Implement native functions in:',
" <comment>resources/android/{$this->pluginData['namespace']}Functions.kt</comment>",
" <comment>resources/ios/{$this->pluginData['namespace']}Functions.swift</comment>",
" <comment>resources/android/src/{$this->pluginData['namespace']}Functions.kt</comment>",
" <comment>resources/ios/Sources/{$this->pluginData['namespace']}Functions.swift</comment>",
'Edit <comment>nativephp.json</comment> to add permissions and dependencies',
'Customize the copy_assets hook in:',
' <comment>src/Commands/CopyAssetsCommand.php</comment>',
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/Plugins/PluginCommandsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ public function plugin_create_generates_swift_example(): void
->assertSuccessful();

// Find Swift files
$swiftFiles = glob($this->testPluginPath.'/resources/ios/*.swift');
$swiftFiles = glob($this->testPluginPath.'/resources/ios/Sources/*.swift');

$this->assertNotEmpty($swiftFiles, 'Should have generated at least one Swift file');

Expand Down