import { projectUtils } from "@atomist/automation-client" ; import { projectClassificationAspect } from "@atomist/sdm-pack-aspect" ; import { Aspect } from "@atomist/sdm-pack-fingerprint" ; const StackName = "stack" ; type { Aspect < ClassificationData > } export const StackAspect = projectClassificationAspect ( { name : StackName , displayName : "stack" , toDisplayableFingerprintName : ( ) => "Technology stack" , } , { tags : "jvm" , reason : "has Maven POM" , test : async ( p ) => p . hasFile ( "pom.xml" ) } , { tags : "jvm" , reason : "has build.gradle" , test : async ( p ) => p . hasFile ( "build.gradle" ) } , { tags : "node" , reason : "has package.json" , test : async ( p ) => p . hasFile ( "package.json" ) } , { tags : "python" , reason : "has requirements.txt" , test : async ( p ) => p . hasFile ( "requirements.txt" ) } , { tags : "python" , reason : "has Python files in root" , test : async ( p ) => await projectUtils . countFiles ( p , "*.py" , async ( ) => true ) > 0 , } , { tags : [ "aws" , "lambda" ] , reason : "has Lambda template" , test : async ( p ) => p . hasFile ( "template.yml" ) , } ) ; export const JavaBuild = projectClassificationAspect ( { name : "javaBuild" , displayName : "Java build tool" , toDisplayableFingerprintName : ( ) => "Java build tool" , } , { tags : "maven" , reason : "has Maven POM" , test : async ( p ) => p . hasFile ( "pom.xml" ) } , { tags : "gradle" , reason : "has build.gradle" , test : async ( p ) => p . hasFile ( "build.gradle" ) } ) ; export const CiAspect = projectClassificationAspect ( { name : "ci" , displayName : undefined , toDisplayableFingerprintName : ( ) => "CI tool" , } , { tags : "travis" , reason : "has .travis.yml" , test : async ( p ) => p . hasFile ( ".travis.yml" ) } , { tags : "jenkins" , reason : "has JenkinsFile" , test : async ( p ) => p . hasFile ( "Jenkinsfile" ) } , { tags : "circle" , reason : "has .circleci/config.yml" , test : async ( p ) => p . hasFile ( ".circleci/config.yml" ) , } , { tags : "concourse" , reason : "has pipeline.yml" , test : async ( p ) => p . hasFile ( "pipeline.yml" ) } ) ;