Skip to content

Commit b656048

Browse files
committed
JAVA-2308: Remove un-used code
1 parent e670a67 commit b656048

File tree

3 files changed

+2
-28
lines changed

3 files changed

+2
-28
lines changed

build.gradle

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -124,16 +124,6 @@ def getGitVersion() {
124124
return outputAsString
125125
}
126126

127-
configure(subprojects.findAll { it.name != 'util' }) {
128-
129-
project.ext.generatedResources = "$buildDir/generated-resources/main"
130-
131-
task generateVersionPropertiesFile << {
132-
def directory = new File(project.ext.generatedResources)
133-
directory.mkdirs()
134-
}
135-
}
136-
137127
configure(subprojects.findAll { it.name != 'util' && it.name != 'mongo-java-driver' }) {
138128
apply plugin: 'checkstyle'
139129
apply plugin: 'findbugs'
@@ -154,7 +144,6 @@ configure(subprojects.findAll { it.name != 'util' && it.name != 'mongo-java-driv
154144
sourceSets {
155145
main {
156146
java.srcDirs = ['src/main']
157-
output.dir(project.ext.generatedResources, builtBy: 'generateVersionPropertiesFile')
158147
}
159148
test {
160149
groovy.srcDirs = ['src/test/functional', 'src/test/unit']

driver-core/src/test/unit/com/mongodb/connection/ClientMetadataHelperSpecification.groovy

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,9 @@ class ClientMetadataHelperSpecification extends Specification {
150150
}
151151

152152
static BsonDocument createExpectedClientMetadataDocument(String appName) {
153+
String driverVersion = 'unknown'
153154
def expectedDriverDocument = new BsonDocument('name', new BsonString('mongo-java-driver'))
154-
.append('version', new BsonString(getDriverVersion()))
155+
.append('version', new BsonString(driverVersion))
155156
def expectedOperatingSystemDocument = new BsonDocument('type',
156157
new BsonString(ClientMetadataHelper.getOperatingSystemType(System.getProperty('os.name'))))
157158
.append('name', new BsonString(System.getProperty('os.name')))
@@ -182,19 +183,4 @@ class ClientMetadataHelperSpecification extends Specification {
182183
expectedClientDocument.append('platform', new BsonString(platforms))
183184
expectedClientDocument
184185
}
185-
186-
187-
// not sure how else to test this. It's really a test of the build system that generates the version.properties file
188-
private static String getDriverVersion() {
189-
String driverVersion = 'unknown';
190-
Class<InternalStreamConnectionInitializer> clazz = InternalStreamConnectionInitializer;
191-
URL versionPropertiesFileURL = clazz.getResource('/version.properties');
192-
if (versionPropertiesFileURL != null) {
193-
Properties versionProperties = new Properties();
194-
InputStream versionPropertiesInputStream = versionPropertiesFileURL.openStream();
195-
versionProperties.load(versionPropertiesInputStream);
196-
driverVersion = versionProperties.getProperty('version');
197-
}
198-
driverVersion;
199-
}
200186
}

mongo-java-driver/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ sourceSets {
3939
main {
4040
java {
4141
srcDirs = ["$rootDir/driver/src/main", "$rootDir/driver-core/src/main", "$rootDir/bson/src/main"]
42-
output.dir(project.ext.generatedResources, builtBy: 'generateVersionPropertiesFile')
4342
}
4443
}
4544
}

0 commit comments

Comments
 (0)