Skip to content
Merged
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
10 changes: 8 additions & 2 deletions src/components/gradleUploadInstructions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import {Fragment} from 'react';
import Image from 'next/image';
import Link from 'next/link';

import getPackageRegistry from 'sentry-docs/build/packageRegistry';

import {CodeBlock} from './codeBlock';
import {CodeTabs} from './codeTabs';
import {GradleFeatureConfig} from './gradleFeatureConfig';
Expand All @@ -12,9 +14,13 @@ type Props = {
feature: 'sizeAnalysis' | 'distribution';
};

export function GradleUploadInstructions({feature}: Props) {
export async function GradleUploadInstructions({feature}: Props) {
const featureName = feature === 'sizeAnalysis' ? 'size analysis' : 'distribution';

const packageRegistry = await getPackageRegistry();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the mdx injection doesn't work here since this is a tsx file so this is the best solution i could come up with.

this code is used for size analysis and build distribution

const gradlePluginVersion =
packageRegistry.data?.['sentry.java.android.gradle-plugin']?.version || '6.0.0';

return (
<Fragment>
<p>
Expand All @@ -29,7 +35,7 @@ export function GradleUploadInstructions({feature}: Props) {
<Link href="/platforms/android/configuration/gradle/">
Sentry Android Gradle plugin
</Link>{' '}
with at least version <code>6.0.0-rc.1</code>
with at least version <code>{gradlePluginVersion}</code>
</li>

<li>
Expand Down
3 changes: 2 additions & 1 deletion src/mdx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,8 @@ export async function getFileBySlug(slug: string): Promise<SlugFile> {
const dependsOnRegistry =
source.includes('@inject') ||
source.includes('<PlatformSDKPackageName') ||
source.includes('<LambdaLayerDetail');
source.includes('<LambdaLayerDetail') ||
source.includes('<GradleUploadInstructions');

// Check cache in CI environments
if (process.env.CI) {
Expand Down
Loading