diff --git a/packages/core/src/amazonqFeatureDev/constants.ts b/packages/core/src/amazonqFeatureDev/constants.ts index d42566de36c..5c00e8d7bfa 100644 --- a/packages/core/src/amazonqFeatureDev/constants.ts +++ b/packages/core/src/amazonqFeatureDev/constants.ts @@ -15,7 +15,7 @@ export const featureDevChat = 'featureDevChat' export const featureName = 'Amazon Q Developer Agent for software development' export const generateDevFilePrompt = - "generate a devfile in my repository. Note that you should only use devfile version 2.0.0 and the only supported command is test, so you should bundle all install, build and test commands in “test”. also you can use “public.ecr.aws/aws-mde/universal-image:latest” as universal image if you aren’t sure which image to use. here is an example for a node repository (but don't assume it's always a node project. look at the existing repository structure before generating the devfile): schemaVersion: 2.0.0 components: - name: dev container: image: public.ecr.aws/aws-mde/universal-image:latest commands: - id: test exec: component: dev commandLine: “npm install && npm run build && npm run test”" + "generate a devfile in my repository. Note that you should only use devfile version 2.0.0 and the only supported commands are install, build and test (are all optional). so you may have to bundle some commands together using '&&'. also you can use ”public.ecr.aws/aws-mde/universal-image:latest” as universal image if you aren’t sure which image to use. here is an example for a node repository (but don't assume it's always a node project. look at the existing repository structure before generating the devfile): schemaVersion: 2.0.0 components: - name: dev container: image: public.ecr.aws/aws-mde/universal-image:latest commands: - id: install exec: component: dev commandLine: ”npm install” - id: build exec: component: dev commandLine: ”npm run build” - id: test exec: component: dev commandLine: ”npm run test”" // Max allowed size for file collection export const maxRepoSizeBytes = 200 * 1024 * 1024 diff --git a/packages/core/src/shared/filetypes.ts b/packages/core/src/shared/filetypes.ts index a53a0d43793..34d6f94f599 100644 --- a/packages/core/src/shared/filetypes.ts +++ b/packages/core/src/shared/filetypes.ts @@ -364,8 +364,15 @@ export const codefileExtensions = new Set([ // Code file names without an extension export const codefileNames = new Set(['Dockerfile', 'Dockerfile.build', 'gradlew', 'mvnw']) +// Build file names +export const buildfileNames = new Set(['gradle/wrapper/gradle-wrapper.jar']) + /** Returns true if `filename` is a code file. */ export function isCodeFile(filename: string): boolean { const ext = path.extname(filename).toLowerCase() - return codefileExtensions.has(ext) || codefileNames.has(path.basename(filename)) + return ( + codefileExtensions.has(ext) || + codefileNames.has(path.basename(filename)) || + buildfileNames.has(path.basename(filename)) + ) } diff --git a/packages/core/src/test/shared/filetypes.test.ts b/packages/core/src/test/shared/filetypes.test.ts index 26e12631419..2ae6e82ff8c 100644 --- a/packages/core/src/test/shared/filetypes.test.ts +++ b/packages/core/src/test/shared/filetypes.test.ts @@ -160,6 +160,7 @@ describe('isCodeFile', () => { 'mvnw', 'build.gradle', 'gradle/wrapper/gradle-wrapper.properties', + 'gradle/wrapper/gradle-wrapper.jar', ] for (const codeFilePath of codeFiles) { assert.strictEqual(isCodeFile(codeFilePath), true)