Azure / draft

A day 0 tool for getting your app on k8s fast
MIT License
493 stars 58 forks source link

Draft Create Auto Detect .gradle file during Java detection #224

Open msftph opened 11 months ago

msftph commented 11 months ago

Is your feature request related to a problem? Please describe. When running draft create on the following repo, draft prompts for gradle or maven https://github.com/codecov/example-java-gradle

[Draft] --- Detecting Language ---
Use the arrow keys to navigate: ↓ ↑ → ←
? Linguist detected Java, are you using maven or gradle?:
  > gradle
    maven

Mention what platform you want to support the new feature OSS

Describe the solution you'd like Draft should detect the *.gradle files in a repository to determine if gradle is used.

Describe alternatives you've considered A better method for detecting gradle or maven could be used. The build files are the best way I could determine.

Additional context (none)

hsubramanianaks commented 11 months ago

@msftph Thanks for raising this request. Are you requesting for draft to detect the languages looking at the files like *.gradle or pom.xml and auto assume without asking the user for confirmation? for ex: `are you using maven or Gradle ? part. If that's the case, we can actually do it, but I need to consult with my team if that's okay.

if file contains pom.xml then
 language = maven 
else if file contains *.gradle then
   if a folder contains gradle/wrapper and it is not empty then 
      language = gradlew
   else 
      language = gradle
else 
  "ask the user to select" ?
msftph commented 11 months ago

Yes. #223 and this issue are similar requests. The idea to default the selection would be the best approach if you can't suppress the message.