2 * Copyright (c) 2017 Red Hat, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.yangtools.yang2sources.plugin;
11 import org.apache.maven.project.MavenProject;
14 * Utility to obtain the correct path to generated directories.
15 * It's important that this does not hard-code "target/" anywhere, but uses
16 * ${project.build.directory}/, to make target-ide/ possible.
18 * @author Michael Vorburger.ch
20 class GeneratedDirectories {
22 private final File targetGeneratedSources;
24 GeneratedDirectories(MavenProject project) {
25 this.targetGeneratedSources = new File(project.getBuild().getDirectory(), "generated-sources");
28 public File getYangServicesDir() {
29 return new File(targetGeneratedSources, "spi");
32 public File getYangDir() {
33 return new File(targetGeneratedSources, "yang");