Skip to content

Commit

Permalink
Use Mozart to bundle composer deps conflict-free
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Wurst <[email protected]>
  • Loading branch information
ChristophWurst committed Mar 26, 2021
1 parent b0a6ff3 commit c74eea0
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
/build
/node_modules
/vendor/
/lib/Vendor
/tests/.phpunit.result.cache
2 changes: 1 addition & 1 deletion appinfo/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
include_once __DIR__ . '/../vendor/autoload.php';
include_once __DIR__ . '/../lib/Vendor/Sentry/functions.php';

\OCP\Util::addScript('sentry', 'sentry');

Expand Down
25 changes: 23 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,41 @@
}
],
"require": {
"sentry/sdk": "^2.0",
"nyholm/psr7": "^1.2",
"php-http/message": "^1.8",
"sentry/sentry": "^2.3"
},
"require-dev": {
"christophwurst/nextcloud_testing": "^0.12.1",
"christophwurst/nextcloud": "^18.0.0",
"roave/security-advisories": "dev-master"
"roave/security-advisories": "dev-master",
"coenjacobs/mozart": "^0.5.1"
},
"scripts": {
"lint": "find . -name \\*.php -not -path './vendor/*' -not -path './build/*' -print0 | xargs -0 -n1 php -l",
"test:integration": "phpunit -c tests/phpunit.integration.xml tests/Integration --fail-on-warning",
"test:integration:dev": "phpunit -c tests/phpunit.integration.xml tests/Integration --no-coverage --fail-on-warning",
"test:unit": "phpunit -c tests/phpunit.unit.xml tests/Unit --fail-on-warning",
"test:unit:dev": "phpunit -c tests/phpunit.unit.xml tests/Unit --no-coverage --fail-on-warning"
"test:unit:dev": "phpunit -c tests/phpunit.unit.xml tests/Unit --no-coverage --fail-on-warning",
"post-install-cmd": [
"\"vendor/bin/mozart\" compose",
"composer dump-autoload"
],
"post-update-cmd": [
"\"vendor/bin/mozart\" compose",
"composer dump-autoload"
]
},
"extra": {
"mozart": {
"dep_namespace": "OCA\\Sentry\\Vendor\\",
"dep_directory": "/lib/Vendor/",
"classmap_directory": "/lib/autoload/",
"classmap_prefix": "NEXTCLOUDSENTRY_",
"packages": [
"sentry/sentry"
]
}
}
}
2 changes: 1 addition & 1 deletion lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@

use OCA\Sentry\Reporter\RecursionAwareReporter;
use OCA\Sentry\Reporter\SentryReporterAdapter;
use function OCA\Sentry\Vendor\Sentry\init as initSentry;
use OCP\AppFramework\App;
use OCP\AppFramework\Http\ContentSecurityPolicy;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\IConfig;
use OCP\IInitialStateService;
use OCP\Security\CSP\AddContentSecurityPolicyEvent;
use OCP\Support\CrashReport\IRegistry;
use function Sentry\init as initSentry;

class Application extends App {

Expand Down
14 changes: 7 additions & 7 deletions lib/Reporter/SentryReporterAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@

use Exception;
use OCA\Sentry\Helper\CredentialStoreHelper;
use function OCA\Sentry\Vendor\Sentry\addBreadcrumb;
use OCA\Sentry\Vendor\Sentry\Breadcrumb;
use function OCA\Sentry\Vendor\Sentry\captureException;
use function OCA\Sentry\Vendor\Sentry\captureMessage;
use function OCA\Sentry\Vendor\Sentry\configureScope;
use OCA\Sentry\Vendor\Sentry\Severity;
use OCA\Sentry\Vendor\Sentry\State\Scope;
use OCP\Authentication\Exceptions\CredentialsUnavailableException;
use OCP\IConfig;
use OCP\ILogger;
use OCP\IUserSession;
use OCP\Support\CrashReport\ICollectBreadcrumbs;
use OCP\Support\CrashReport\IMessageReporter;
use function Sentry\addBreadcrumb;
use Sentry\Breadcrumb;
use function Sentry\captureException;
use function Sentry\captureMessage;
use function Sentry\configureScope;
use Sentry\Severity;
use Sentry\State\Scope;
use Throwable;

class SentryReporterAdapter implements IMessageReporter, ICollectBreadcrumbs {
Expand Down

0 comments on commit c74eea0

Please sign in to comment.