-
Notifications
You must be signed in to change notification settings - Fork 0
/
java_detector.go
32 lines (28 loc) · 1.06 KB
/
java_detector.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*******************************************************************************
* Copyright (c) 2021 Red Hat, Inc.
* Distributed under license by Red Hat, Inc. All rights reserved.
* This program is made available under the terms of the
* Eclipse Public License v2.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v20.html
*
* Contributors:
* Red Hat, Inc.
******************************************************************************/
package enricher
import (
"github.com/mike-hoang/alizer-copy/go/pkg/utils"
)
type ApplicationPropertiesFile struct {
Dir string
File string
}
// hasFramework uses the build.gradle, groupId, and artifactId to check for framework
func hasFramework(configFile, groupId, artifactId string) (bool, error) {
if utils.IsPathOfWantedFile(configFile, "build.gradle") {
return utils.IsTagInFile(configFile, groupId)
} else if artifactId != "" {
return utils.IsTagInPomXMLFileArtifactId(configFile, groupId, artifactId)
} else {
return utils.IsTagInPomXMLFile(configFile, groupId)
}
}