Skip to content

Commit c89f996

Browse files
committed
move internal exclude list to interternal config
this was not possible before because the test logic lived in another repo than the config
1 parent d9a2e33 commit c89f996

File tree

2 files changed

+37
-34
lines changed

2 files changed

+37
-34
lines changed

config/nativephp-internal.php

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,42 @@
6161
'code_signing_account_name' => env('NATIVEPHP_AZURE_CODE_SIGNING_ACCOUNT_NAME'),
6262
],
6363

64+
/**
65+
* A list of files and folders that should be removed.
66+
*/
67+
'cleanup_exclude_files' => [
68+
// .git and dev directories
69+
'.git',
70+
'dist',
71+
'build',
72+
'temp',
73+
'extras',
74+
'docker',
75+
'packages',
76+
'**/.github',
77+
78+
// Potentially containing sensitive info
79+
'auth.json', // Composer auth file
80+
'database/*.sqlite',
81+
'database/*.sqlite-shm',
82+
'database/*.sqlite-wal',
83+
84+
'storage/framework/sessions/*',
85+
'storage/framework/testing/*',
86+
'storage/framework/cache/*',
87+
'storage/framework/views/*',
88+
'storage/logs/*',
89+
'storage/hot',
90+
91+
// Only needed for local testing
92+
'vendor/nativephp/desktop/resources',
93+
'vendor/nativephp/desktop/vendor',
94+
'vendor/nativephp/php-bin',
95+
96+
// Also deleted in PrunesVendorDirectory after fresh composer install
97+
'vendor/bin',
98+
],
99+
64100
/**
65101
* The binary path of PHP for NativePHP to use at build.
66102
*/

src/Electron/Traits/CopiesToBuildDirectory.php

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -23,47 +23,14 @@ abstract protected function buildPath(string $path = ''): string;
2323

2424
abstract protected function sourcePath(string $path = ''): string;
2525

26-
public array $cleanupExcludeFiles = [
27-
// .git and dev directories
28-
'.git',
29-
'dist',
30-
'build',
31-
'temp',
32-
'extras',
33-
'docker',
34-
'packages',
35-
'**/.github',
36-
37-
// Potentially containing sensitive info
38-
'auth.json', // Composer auth file
39-
'database/*.sqlite',
40-
'database/*.sqlite-shm',
41-
'database/*.sqlite-wal',
42-
43-
'storage/framework/sessions/*',
44-
'storage/framework/testing/*',
45-
'storage/framework/cache/*',
46-
'storage/framework/views/*',
47-
'storage/logs/*',
48-
'storage/hot',
49-
50-
// Only needed for local testing
51-
'vendor/nativephp/desktop/resources',
52-
'vendor/nativephp/desktop/vendor',
53-
'vendor/nativephp/php-bin',
54-
55-
// Also deleted in PrunesVendorDirectory after fresh composer install
56-
'vendor/bin',
57-
];
58-
5926
public function copyToBuildDirectory(): bool
6027
{
6128
$sourcePath = $this->sourcePath();
6229
$buildPath = $this->buildPath();
6330
$filesystem = new Filesystem;
6431

6532
$patterns = array_merge(
66-
$this->cleanupExcludeFiles,
33+
config('nativephp-internal.cleanup_exclude_files', []),
6734
config('nativephp.cleanup_exclude_files', []),
6835
);
6936

0 commit comments

Comments
 (0)