Browse Source
The presence of the buildSrc subproject is causing problems when we try to run installAll, jarAll, and the other "all" targets. It's easier just to make the generator code a regular subproject and use the JavaExec gradle task to run the code. This also makes it more straightforward to run the generator unit tests. Reviewers: David Arthur <mumrah@gmail.com>, Ismael Juma <ismael@juma.me.uk> Co-authored-by: Colin P. Mccabe <cmccabe@confluent.io> Co-authored-by: Stanislav Kozlovski <stanislav_kozlovski@outlook.com>pull/6296/head
Stanislav Kozlovski
6 years ago
committed by
Ismael Juma
18 changed files with 57 additions and 137 deletions
@ -1,26 +0,0 @@
@@ -1,26 +0,0 @@
|
||||
// Licensed to the Apache Software Foundation (ASF) under one or more |
||||
// contributor license agreements. See the NOTICE file distributed with |
||||
// this work for additional information regarding copyright ownership. |
||||
// The ASF licenses this file to You under the Apache License, Version 2.0 |
||||
// (the "License"); you may not use this file except in compliance with |
||||
// the License. You may obtain a copy of the License at |
||||
// |
||||
// http://www.apache.org/licenses/LICENSE-2.0 |
||||
// |
||||
// Unless required by applicable law or agreed to in writing, software |
||||
// distributed under the License is distributed on an "AS IS" BASIS, |
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
// See the License for the specific language governing permissions and |
||||
// limitations under the License. |
||||
|
||||
repositories { |
||||
mavenCentral() |
||||
} |
||||
|
||||
dependencies { |
||||
compile "com.fasterxml.jackson.core:jackson-databind:2.9.6" |
||||
compile "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:2.9.6" |
||||
compile "com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.9.6" |
||||
} |
||||
|
||||
test.enabled=false |
@ -1,68 +0,0 @@
@@ -1,68 +0,0 @@
|
||||
/* |
||||
* Licensed to the Apache Software Foundation (ASF) under one or more |
||||
* contributor license agreements. See the NOTICE file distributed with |
||||
* this work for additional information regarding copyright ownership. |
||||
* The ASF licenses this file to You under the Apache License, Version 2.0 |
||||
* (the "License"); you may not use this file except in compliance with |
||||
* the License. You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
package org.apache.kafka.task; |
||||
|
||||
import org.apache.kafka.message.MessageGenerator; |
||||
import org.gradle.api.DefaultTask; |
||||
import org.gradle.api.tasks.InputDirectory; |
||||
import org.gradle.api.tasks.OutputFiles; |
||||
import org.gradle.api.tasks.TaskAction; |
||||
|
||||
import java.io.File; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* A gradle task which processes a directory full of JSON files into an output directory. |
||||
*/ |
||||
public class ProcessMessagesTask extends DefaultTask { |
||||
/** |
||||
* The directory where we should read the input JSON from. |
||||
*/ |
||||
public File inputDirectory; |
||||
|
||||
/** |
||||
* The directory that we should write output JSON to. |
||||
*/ |
||||
public File outputDirectory; |
||||
|
||||
@InputDirectory |
||||
public File getInputDirectory() { |
||||
return inputDirectory; |
||||
} |
||||
|
||||
/** |
||||
* Define the task outputs. |
||||
* |
||||
* Gradle consults this to see if the task is up-to-date. |
||||
*/ |
||||
@OutputFiles |
||||
public Map<String, File> getOutputFiles() throws Exception { |
||||
return MessageGenerator.getOutputFiles( |
||||
outputDirectory.toString(), inputDirectory.toString()); |
||||
} |
||||
|
||||
@TaskAction |
||||
public void run() { |
||||
try { |
||||
MessageGenerator.processDirectories( |
||||
outputDirectory.toString(), inputDirectory.toString()); |
||||
} catch (Exception e) { |
||||
throw new RuntimeException(e); |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue