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 Dec 29, 2021
1 parent 6f1408a commit 0f90325
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
26 changes: 23 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,40 @@
}
],
"require": {
"nyholm/psr7": "^1.4",
"sentry/sdk": "^2.0",
"php-http/curl-client": "^2.2",
"sentry/sentry": "^3.3"
},
"require-dev": {
"christophwurst/nextcloud_testing": "^0.12.4",
"christophwurst/nextcloud": "^21.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 @@ -30,6 +30,7 @@
use OCA\Sentry\Reporter\ISentryReporter;
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\Bootstrap\IBootContext;
use OCP\AppFramework\Bootstrap\IBootstrap;
Expand All @@ -44,7 +45,6 @@
use OCP\Util;
use Psr\Container\ContainerInterface;
use function parse_url;
use function Sentry\init as initSentry;

class Application extends App implements IBootstrap {

Expand Down
1 change: 1 addition & 0 deletions lib/Reporter/ISentryReporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
include_once __DIR__ . '/../lib/Vendor/Sentry/functions.php';

namespace OCA\Sentry\Reporter;

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, ISentryReporter {
Expand Down

0 comments on commit 0f90325

Please sign in to comment.