소스 검색

Merge remote-tracking branch 'origin/master'

tags/2.5-rc1
Simon Brandhof 11 년 전
부모
커밋
959d97841d
18개의 변경된 파일212개의 추가작업 그리고 71개의 파일을 삭제
  1. 18
    3
      src/main/java/org/sonar/runner/Runner.java
  2. 15
    3
      src/main/java/org/sonar/runner/internal/batch/Launcher.java
  3. 57
    37
      src/main/java/org/sonar/runner/internal/batch/SonarProjectBuilder.java
  4. 3
    3
      src/test/java/org/sonar/runner/internal/batch/LauncherTest.java
  5. 82
    24
      src/test/java/org/sonar/runner/internal/batch/SonarProjectBuilderTest.java
  6. 0
    0
      src/test/resources/org/sonar/runner/internal/batch/SonarProjectBuilderTest/multi-module-definitions-all-in-root/module1/sources/Fake.java
  7. 0
    0
      src/test/resources/org/sonar/runner/internal/batch/SonarProjectBuilderTest/multi-module-definitions-all-in-root/module2/src/Fake.java
  8. 0
    0
      src/test/resources/org/sonar/runner/internal/batch/SonarProjectBuilderTest/multi-module-definitions-all-in-root/sonar-project.properties
  9. 2
    0
      src/test/resources/org/sonar/runner/internal/batch/SonarProjectBuilderTest/multi-module-definitions-in-each-module/module1/sonar-project.properties
  10. 1
    0
      src/test/resources/org/sonar/runner/internal/batch/SonarProjectBuilderTest/multi-module-definitions-in-each-module/module1/sources/Fake.java
  11. 1
    0
      src/test/resources/org/sonar/runner/internal/batch/SonarProjectBuilderTest/multi-module-definitions-in-each-module/module2/newBaseDir/src/Fake.java
  12. 6
    0
      src/test/resources/org/sonar/runner/internal/batch/SonarProjectBuilderTest/multi-module-definitions-in-each-module/module2/sonar-project.properties
  13. 11
    0
      src/test/resources/org/sonar/runner/internal/batch/SonarProjectBuilderTest/multi-module-definitions-in-each-module/sonar-project.properties
  14. 0
    0
      src/test/resources/org/sonar/runner/internal/batch/SonarProjectBuilderTest/multi-module-with-configfile-and-overwritten-basedir/any-folder/generated/any-file.properties
  15. 1
    0
      src/test/resources/org/sonar/runner/internal/batch/SonarProjectBuilderTest/multi-module-with-configfile-and-overwritten-basedir/any-folder/sources/Fake.java
  16. 12
    0
      src/test/resources/org/sonar/runner/internal/batch/SonarProjectBuilderTest/multi-module-with-configfile-and-overwritten-basedir/sonar-project.properties
  17. 2
    0
      src/test/resources/org/sonar/runner/internal/batch/SonarProjectBuilderTest/multi-module-with-configfile/any-folder/any-file.properties
  18. 1
    1
      src/test/resources/org/sonar/runner/internal/batch/SonarProjectBuilderTest/multi-module-with-configfile/sonar-project.properties

+ 18
- 3
src/main/java/org/sonar/runner/Runner.java 파일 보기

@@ -29,6 +29,8 @@ import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;

/**
@@ -106,10 +108,13 @@ public final class Runner {

private File projectDir;
private File workDir;
private String[] unmaskedPackages;
private List<Object> containerExtensions = new ArrayList<Object>();
private Properties properties;

private Runner(Properties props) {
this.properties = props;
this.unmaskedPackages = new String[0];
// set the default values for the Sonar Runner - they can be overriden with #setEnvironmentInformation
this.properties.put(PROPERTY_ENVIRONMENT_INFORMATION_KEY, "Runner");
this.properties.put(PROPERTY_ENVIRONMENT_INFORMATION_VERSION, SonarRunnerVersion.getVersion());
@@ -204,7 +209,8 @@ public final class Runner {
URL url = getClass().getProtectionDomain().getCodeSource().getLocation();
return bootstrapper.createClassLoader(
new URL[] {url}, // Add JAR with Sonar Runner - it's a Jar which contains this class
getClass().getClassLoader());
getClass().getClassLoader(),
unmaskedPackages);
}

static boolean isUnsupportedVersion(String version) {
@@ -230,8 +236,8 @@ public final class Runner {
try {
Thread.currentThread().setContextClassLoader(sonarClassLoader);
Class<?> launcherClass = sonarClassLoader.findClass("org.sonar.runner.internal.batch.Launcher");
Constructor<?> constructor = launcherClass.getConstructor(Properties.class);
Object launcher = constructor.newInstance(getProperties());
Constructor<?> constructor = launcherClass.getConstructor(Properties.class, List.class);
Object launcher = constructor.newInstance(getProperties(), containerExtensions);
Method method = launcherClass.getMethod("execute");
method.invoke(launcher);
} catch (InvocationTargetException e) {
@@ -255,4 +261,13 @@ public final class Runner {
this.properties.put(PROPERTY_ENVIRONMENT_INFORMATION_KEY, key);
this.properties.put(PROPERTY_ENVIRONMENT_INFORMATION_VERSION, version);
}

public void setUnmaskedPackages(String... unmaskedPackages) {
this.unmaskedPackages = unmaskedPackages;
}

public void addContainerExtension(Object extension) {
containerExtensions.add(extension);
}

}

+ 15
- 3
src/main/java/org/sonar/runner/internal/batch/Launcher.java 파일 보기

@@ -39,6 +39,7 @@ import org.sonar.batch.bootstrapper.EnvironmentInformation;
import org.sonar.runner.Runner;

import java.io.InputStream;
import java.util.List;
import java.util.Properties;

/**
@@ -48,9 +49,11 @@ import java.util.Properties;
public class Launcher {

private Properties propertiesFromRunner;
private List<Object> containerExtensions;

public Launcher(Properties properties) {
public Launcher(Properties properties, List<Object> containerExtensions) {
this.propertiesFromRunner = properties;
this.containerExtensions = containerExtensions;
}

/**
@@ -64,13 +67,22 @@ public class Launcher {
}

private void executeBatch(ProjectDefinition project, Configuration initialConfiguration) {
ProjectReactor reactor = new ProjectReactor(project);
setContainerExtensionsOnProject(project);
String envKey = propertiesFromRunner.getProperty(Runner.PROPERTY_ENVIRONMENT_INFORMATION_KEY);
String envVersion = propertiesFromRunner.getProperty(Runner.PROPERTY_ENVIRONMENT_INFORMATION_VERSION);
Batch batch = Batch.create(reactor, initialConfiguration, new EnvironmentInformation(envKey, envVersion));
Batch batch = Batch.create(new ProjectReactor(project), initialConfiguration, new EnvironmentInformation(envKey, envVersion));
batch.execute();
}

private void setContainerExtensionsOnProject(ProjectDefinition projectDefinition) {
for (Object extension : containerExtensions) {
projectDefinition.addContainerExtension(extension);
}
for (ProjectDefinition module : projectDefinition.getSubProjects()) {
setContainerExtensionsOnProject(module);
}
}

private void initLogging(Configuration initialConfiguration) {
LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
JoranConfigurator jc = new JoranConfigurator();

+ 57
- 37
src/main/java/org/sonar/runner/internal/batch/SonarProjectBuilder.java 파일 보기

@@ -152,12 +152,7 @@ public final class SonarProjectBuilder {
if (parentProps.containsKey(PROPERTY_MODULES)) {
for (String module : SonarRunnerUtils.getListFromProperty(parentProps, PROPERTY_MODULES)) {
Properties moduleProps = extractModuleProperties(module, parentProps);
ProjectDefinition childProject = null;
if (moduleProps.containsKey(PROPERTY_PROJECT_CONFIG_FILE)) {
childProject = loadChildProjectFromPropertyFile(parentProject, moduleProps, module);
} else {
childProject = loadChildProjectFromProperties(parentProject, moduleProps, module);
}
ProjectDefinition childProject = loadChildProject(parentProject, moduleProps, module);
// check the unicity of the child key
checkUnicityOfChildKey(childProject, parentProject);
// the child project may have children as well
@@ -168,52 +163,76 @@ public final class SonarProjectBuilder {
}
}

private ProjectDefinition loadChildProjectFromProperties(ProjectDefinition parentProject, Properties childProps, String moduleId) {
setProjectKeyIfNotDefined(childProps, moduleId);
checkMandatoryProperties(moduleId, childProps, MANDATORY_PROPERTIES_FOR_CHILD);
mergeParentProperties(childProps, parentProject.getProperties());
private ProjectDefinition loadChildProject(ProjectDefinition parentProject, Properties moduleProps, String moduleId) {
setProjectKeyIfNotDefined(moduleProps, moduleId);

File baseDir = null;
if (childProps.containsKey(PROPERTY_PROJECT_BASEDIR)) {
baseDir = getFileFromPath(childProps.getProperty(PROPERTY_PROJECT_BASEDIR), parentProject.getBaseDir());
if (moduleProps.containsKey(PROPERTY_PROJECT_BASEDIR)) {
File baseDir = getFileFromPath(moduleProps.getProperty(PROPERTY_PROJECT_BASEDIR), parentProject.getBaseDir());
setProjectBaseDir(baseDir, moduleProps, moduleId);
tryToFindAndLoadPropsFile(baseDir, moduleProps, moduleId);
} else if (moduleProps.containsKey(PROPERTY_PROJECT_CONFIG_FILE)) {
loadPropsFile(parentProject, moduleProps, moduleId);
} else {
baseDir = new File(parentProject.getBaseDir(), moduleId);
File baseDir = new File(parentProject.getBaseDir(), moduleId);
setProjectBaseDir(baseDir, moduleProps, moduleId);
tryToFindAndLoadPropsFile(baseDir, moduleProps, moduleId);
}
setProjectBaseDirOnProperties(childProps, moduleId, baseDir);
prefixProjectKeyWithParentKey(childProps, parentProject.getKey());

return defineProject(childProps);
// and finish
checkMandatoryProperties(moduleId, moduleProps, MANDATORY_PROPERTIES_FOR_CHILD);
mergeParentProperties(moduleProps, parentProject.getProperties());

prefixProjectKeyWithParentKey(moduleProps, parentProject.getKey());

return defineProject(moduleProps);
}

private ProjectDefinition loadChildProjectFromPropertyFile(ProjectDefinition parentProject, Properties moduleProps, String moduleId) {
protected void loadPropsFile(ProjectDefinition parentProject, Properties moduleProps, String moduleId) {
File propertyFile = getFileFromPath(moduleProps.getProperty(PROPERTY_PROJECT_CONFIG_FILE), parentProject.getBaseDir());
if (!propertyFile.isFile()) {
if (propertyFile.isFile()) {
Properties propsFromFile = toProperties(propertyFile);
for (Entry<Object, Object> entry : propsFromFile.entrySet()) {
moduleProps.put(entry.getKey(), entry.getValue());
}
File baseDir = null;
if (moduleProps.containsKey(PROPERTY_PROJECT_BASEDIR)) {
baseDir = getFileFromPath(moduleProps.getProperty(PROPERTY_PROJECT_BASEDIR), propertyFile.getParentFile());
} else {
baseDir = propertyFile.getParentFile();
}
setProjectBaseDir(baseDir, moduleProps, moduleId);
} else {
throw new RunnerException("The properties file of the module '" + moduleId + "' does not exist: " + propertyFile.getAbsolutePath());
}
Properties childProps = new Properties();
}

private void tryToFindAndLoadPropsFile(File baseDir, Properties moduleProps, String moduleId) {
File propertyFile = new File(baseDir, "sonar-project.properties");
if (propertyFile.isFile()) {
Properties propsFromFile = toProperties(propertyFile);
for (Entry<Object, Object> entry : propsFromFile.entrySet()) {
moduleProps.put(entry.getKey(), entry.getValue());
}
if (moduleProps.containsKey(PROPERTY_PROJECT_BASEDIR)) {
File overwrittenBaseDir = getFileFromPath(moduleProps.getProperty(PROPERTY_PROJECT_BASEDIR), propertyFile.getParentFile());
setProjectBaseDir(overwrittenBaseDir, moduleProps, moduleId);
}
}
}

@VisibleForTesting
protected static Properties toProperties(File propertyFile) {
Properties propsFromFile = new Properties();
FileInputStream fileInputStream = null;
try {
fileInputStream = new FileInputStream(propertyFile);
childProps.load(fileInputStream);
propsFromFile.load(fileInputStream);
} catch (IOException e) {
throw new RunnerException("Impossible to read the property file: " + propertyFile.getAbsolutePath(), e);
} finally {
IOUtils.closeQuietly(fileInputStream);
}

checkMandatoryProperties(moduleId, childProps, MANDATORY_PROPERTIES_FOR_CHILD);
mergeParentProperties(childProps, parentProject.getProperties());

File baseDir = null;
if (childProps.containsKey(PROPERTY_PROJECT_BASEDIR)) {
baseDir = getFileFromPath(childProps.getProperty(PROPERTY_PROJECT_BASEDIR), propertyFile.getParentFile());
} else {
baseDir = propertyFile.getParentFile();
}
setProjectBaseDirOnProperties(childProps, moduleId, baseDir);
prefixProjectKeyWithParentKey(childProps, parentProject.getKey());

return defineProject(childProps);
return propsFromFile;
}

@VisibleForTesting
@@ -238,7 +257,7 @@ public final class SonarProjectBuilder {
childProps.put(PROPERTY_PROJECT_KEY, parentKey + ":" + childKey);
}

private static void setProjectBaseDirOnProperties(Properties childProps, String moduleId, File baseDir) {
private static void setProjectBaseDir(File baseDir, Properties childProps, String moduleId) {
if (!baseDir.isDirectory()) {
throw new RunnerException("The base directory of the module '" + moduleId + "' does not exist: " + baseDir.getAbsolutePath());
}
@@ -258,7 +277,8 @@ public final class SonarProjectBuilder {
}
}
if (missing.length() != 0) {
throw new RunnerException("You must define the following mandatory properties for '" + moduleId + "': " + missing);
String projectKey = props.getProperty(PROPERTY_PROJECT_KEY);
throw new RunnerException("You must define the following mandatory properties for '" + (projectKey == null ? moduleId : projectKey) + "': " + missing);
}
}


+ 3
- 3
src/test/java/org/sonar/runner/internal/batch/LauncherTest.java 파일 보기

@@ -19,7 +19,7 @@
*/
package org.sonar.runner.internal.batch;

import com.google.common.collect.Lists;
import org.apache.commons.configuration.BaseConfiguration;
import org.apache.commons.configuration.Configuration;
import org.junit.Test;
@@ -60,7 +60,7 @@ public class LauncherTest {
@Test
public void shouldDetermineVerboseMode() {
Properties properties = new Properties();
Launcher launcher = new Launcher(properties);
Launcher launcher = new Launcher(properties, Lists.newArrayList());
assertThat(launcher.isDebug()).isFalse();
properties.setProperty(Runner.PROPERTY_VERBOSE, "true");
assertThat(launcher.isDebug()).isTrue();
@@ -69,7 +69,7 @@ public class LauncherTest {
@Test
public void shouldSupportDeprecatedDebugProperty() {
Properties properties = new Properties();
Launcher launcher = new Launcher(properties);
Launcher launcher = new Launcher(properties, Lists.newArrayList());
properties.setProperty(Runner.PROPERTY_OLD_DEBUG_MODE, "true");
assertThat(launcher.isDebug()).isTrue();
}

+ 82
- 24
src/test/java/org/sonar/runner/internal/batch/SonarProjectBuilderTest.java 파일 보기

@@ -19,7 +19,6 @@
*/
package org.sonar.runner.internal.batch;

import org.apache.commons.io.IOUtils;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
@@ -28,7 +27,6 @@ import org.sonar.runner.RunnerException;
import org.sonar.test.TestUtils;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.List;
@@ -78,8 +76,8 @@ public class SonarProjectBuilderTest {
}

@Test
public void shouldDefineMultiModuleProject() throws IOException {
ProjectDefinition rootProject = loadProjectDefinition("multi-module");
public void shouldDefineMultiModuleProjectWithDefinitionsAllInRootProject() throws IOException {
ProjectDefinition rootProject = loadProjectDefinition("multi-module-definitions-all-in-root");

// CHECK ROOT
assertThat(rootProject.getKey()).isEqualTo("com.foo.project");
@@ -100,6 +98,7 @@ public class SonarProjectBuilderTest {

// Module 1
ProjectDefinition module1 = modules.get(0);
assertThat(module1.getBaseDir().getCanonicalFile()).isEqualTo(TestUtils.getResource(this.getClass(), "multi-module-definitions-all-in-root/module1"));
assertThat(module1.getKey()).isEqualTo("com.foo.project:com.foo.project.module1");
assertThat(module1.getName()).isEqualTo("Foo Module 1");
assertThat(module1.getVersion()).isEqualTo("1.0-SNAPSHOT");
@@ -114,6 +113,58 @@ public class SonarProjectBuilderTest {

// Module 2
ProjectDefinition module2 = modules.get(1);
assertThat(module2.getBaseDir().getCanonicalFile()).isEqualTo(TestUtils.getResource(this.getClass(), "multi-module-definitions-all-in-root/module2"));
assertThat(module2.getKey()).isEqualTo("com.foo.project:com.foo.project.module2");
assertThat(module2.getName()).isEqualTo("Foo Module 2");
assertThat(module2.getVersion()).isEqualTo("1.0-SNAPSHOT");
assertThat(module2.getDescription()).isEqualTo("Description of Module 2");
assertThat(module2.getSourceDirs()).contains("src");
assertThat(module2.getTestDirs()).contains("tests");
assertThat(module2.getBinaries()).contains("target/classes");
// and module properties must have been cleaned
assertThat(rootProject.getProperties().getProperty("module1.sonar.projectKey")).isNull();
assertThat(rootProject.getProperties().getProperty("module2.sonar.projectKey")).isNull();
}

@Test
public void shouldDefineMultiModuleProjectWithDefinitionsAllInEachModule() throws IOException {
ProjectDefinition rootProject = loadProjectDefinition("multi-module-definitions-in-each-module");

// CHECK ROOT
assertThat(rootProject.getKey()).isEqualTo("com.foo.project");
assertThat(rootProject.getName()).isEqualTo("Foo Project");
assertThat(rootProject.getVersion()).isEqualTo("1.0-SNAPSHOT");
assertThat(rootProject.getDescription()).isEqualTo("Description of Foo Project");
// root project must not contain some properties - even if they are defined in the root properties file
assertThat(rootProject.getSourceDirs().contains("sources")).isFalse();
assertThat(rootProject.getTestDirs().contains("tests")).isFalse();
assertThat(rootProject.getBinaries().contains("target/classes")).isFalse();
// and module properties must have been cleaned
assertThat(rootProject.getProperties().getProperty("module1.sonar.projectKey")).isNull();
assertThat(rootProject.getProperties().getProperty("module2.sonar.projectKey")).isNull();

// CHECK MODULES
List<ProjectDefinition> modules = rootProject.getSubProjects();
assertThat(modules.size()).isEqualTo(2);

// Module 1
ProjectDefinition module1 = modules.get(0);
assertThat(module1.getBaseDir().getCanonicalFile()).isEqualTo(TestUtils.getResource(this.getClass(), "multi-module-definitions-in-each-module/module1"));
assertThat(module1.getKey()).isEqualTo("com.foo.project:com.foo.project.module1");
assertThat(module1.getName()).isEqualTo("Foo Module 1");
assertThat(module1.getVersion()).isEqualTo("1.0-SNAPSHOT");
// Description should not be inherited from parent if not set
assertThat(module1.getDescription()).isNull();
assertThat(module1.getSourceDirs()).contains("sources");
assertThat(module1.getTestDirs()).contains("tests");
assertThat(module1.getBinaries()).contains("target/classes");
// and module properties must have been cleaned
assertThat(rootProject.getProperties().getProperty("module1.sonar.projectKey")).isNull();
assertThat(rootProject.getProperties().getProperty("module2.sonar.projectKey")).isNull();

// Module 2
ProjectDefinition module2 = modules.get(1);
assertThat(module2.getBaseDir().getCanonicalFile()).isEqualTo(TestUtils.getResource(this.getClass(), "multi-module-definitions-in-each-module/module2/newBaseDir"));
assertThat(module2.getKey()).isEqualTo("com.foo.project:com.foo.project.module2");
assertThat(module2.getName()).isEqualTo("Foo Module 2");
assertThat(module2.getVersion()).isEqualTo("1.0-SNAPSHOT");
@@ -145,6 +196,17 @@ public class SonarProjectBuilderTest {
assertThat(module.getBaseDir().getCanonicalFile()).isEqualTo(TestUtils.getResource(this.getClass(), "multi-module-with-configfile/any-folder"));
}

@Test
public void shouldDefineMultiModuleProjectWithConfigFileAndOverwrittenBasedir() throws IOException {
ProjectDefinition rootProject = loadProjectDefinition("multi-module-with-configfile-and-overwritten-basedir");
List<ProjectDefinition> modules = rootProject.getSubProjects();
assertThat(modules.size()).isEqualTo(1);
ProjectDefinition module = modules.get(0);
assertThat(module.getKey()).isEqualTo("com.foo.project:com.foo.project.module1");
// verify the base directory that has been changed in this config file
assertThat(module.getBaseDir().getCanonicalFile()).isEqualTo(TestUtils.getResource(this.getClass(), "multi-module-with-configfile-and-overwritten-basedir/any-folder"));
}

@Test
public void shouldFailIfUnexistingModuleBaseDir() throws IOException {
thrown.expect(RunnerException.class);
@@ -275,26 +337,6 @@ public class SonarProjectBuilderTest {
assertThat(childProps.getProperty("mod2.sonar.projectkey")).isNull();
}

private ProjectDefinition loadProjectDefinition(String projectFolder) throws FileNotFoundException, IOException {
Properties props = loadPropsFromFile(projectFolder + "/sonar-project.properties");
props.put("sonar.projectBaseDir", TestUtils.getResource(this.getClass(), projectFolder).getAbsolutePath());
ProjectDefinition projectDefinition = SonarProjectBuilder.create(props)
.generateProjectDefinition();
return projectDefinition;
}

private Properties loadPropsFromFile(String filePath) throws FileNotFoundException, IOException {
Properties props = new Properties();
FileInputStream fileInputStream = null;
try {
fileInputStream = new FileInputStream(TestUtils.getResource(this.getClass(), filePath));
props.load(fileInputStream);
} finally {
IOUtils.closeQuietly(fileInputStream);
}
return props;
}

@Test
public void shouldInitWorkDir() {
SonarProjectBuilder builder = SonarProjectBuilder.create(new Properties());
@@ -377,4 +419,20 @@ public class SonarProjectBuilderTest {
assertThat(props.getProperty("sonar.projectKey")).isEqualTo("foo");
}

@Test
public void shouldFailToLoadPropertiesFile() throws Exception {
thrown.expect(RunnerException.class);
thrown.expectMessage("Impossible to read the property file");

SonarProjectBuilder.toProperties(new File("foo.properties"));
}

private ProjectDefinition loadProjectDefinition(String projectFolder) throws FileNotFoundException, IOException {
Properties props = SonarProjectBuilder.toProperties(TestUtils.getResource(this.getClass(), projectFolder + "/sonar-project.properties"));
props.put("sonar.projectBaseDir", TestUtils.getResource(this.getClass(), projectFolder).getAbsolutePath());
ProjectDefinition projectDefinition = SonarProjectBuilder.create(props)
.generateProjectDefinition();
return projectDefinition;
}

}

src/test/resources/org/sonar/runner/internal/batch/SonarProjectBuilderTest/multi-module/module1/sources/Fake.java → src/test/resources/org/sonar/runner/internal/batch/SonarProjectBuilderTest/multi-module-definitions-all-in-root/module1/sources/Fake.java 파일 보기


src/test/resources/org/sonar/runner/internal/batch/SonarProjectBuilderTest/multi-module/module2/src/Fake.java → src/test/resources/org/sonar/runner/internal/batch/SonarProjectBuilderTest/multi-module-definitions-all-in-root/module2/src/Fake.java 파일 보기


src/test/resources/org/sonar/runner/internal/batch/SonarProjectBuilderTest/multi-module/sonar-project.properties → src/test/resources/org/sonar/runner/internal/batch/SonarProjectBuilderTest/multi-module-definitions-all-in-root/sonar-project.properties 파일 보기


+ 2
- 0
src/test/resources/org/sonar/runner/internal/batch/SonarProjectBuilderTest/multi-module-definitions-in-each-module/module1/sonar-project.properties 파일 보기

@@ -0,0 +1,2 @@
sonar.projectKey=com.foo.project.module1
sonar.projectName=Foo Module 1

+ 1
- 0
src/test/resources/org/sonar/runner/internal/batch/SonarProjectBuilderTest/multi-module-definitions-in-each-module/module1/sources/Fake.java 파일 보기

@@ -0,0 +1 @@
Fake

+ 1
- 0
src/test/resources/org/sonar/runner/internal/batch/SonarProjectBuilderTest/multi-module-definitions-in-each-module/module2/newBaseDir/src/Fake.java 파일 보기

@@ -0,0 +1 @@
Fake

+ 6
- 0
src/test/resources/org/sonar/runner/internal/batch/SonarProjectBuilderTest/multi-module-definitions-in-each-module/module2/sonar-project.properties 파일 보기

@@ -0,0 +1,6 @@
sonar.projectKey=com.foo.project.module2
sonar.projectName=Foo Module 2
# redefine some properties
sonar.projectBaseDir=newBaseDir
sonar.projectDescription=Description of Module 2
sonar.sources=src

+ 11
- 0
src/test/resources/org/sonar/runner/internal/batch/SonarProjectBuilderTest/multi-module-definitions-in-each-module/sonar-project.properties 파일 보기

@@ -0,0 +1,11 @@
sonar.projectKey=com.foo.project
sonar.projectName=Foo Project
sonar.projectVersion=1.0-SNAPSHOT
sonar.projectDescription=Description of Foo Project

sonar.sources=sources
sonar.tests=tests
sonar.binaries=target/classes

sonar.modules=module1,\
module2

src/test/resources/org/sonar/runner/internal/batch/SonarProjectBuilderTest/multi-module-with-configfile/any-folder/generated/any-file.properties → src/test/resources/org/sonar/runner/internal/batch/SonarProjectBuilderTest/multi-module-with-configfile-and-overwritten-basedir/any-folder/generated/any-file.properties 파일 보기


+ 1
- 0
src/test/resources/org/sonar/runner/internal/batch/SonarProjectBuilderTest/multi-module-with-configfile-and-overwritten-basedir/any-folder/sources/Fake.java 파일 보기

@@ -0,0 +1 @@
Fake

+ 12
- 0
src/test/resources/org/sonar/runner/internal/batch/SonarProjectBuilderTest/multi-module-with-configfile-and-overwritten-basedir/sonar-project.properties 파일 보기

@@ -0,0 +1,12 @@
sonar.projectKey=com.foo.project
sonar.projectName=Foo Project
sonar.projectVersion=1.0-SNAPSHOT
sonar.projectDescription=Description of Foo Project

sonar.sources=sources
sonar.tests=tests
sonar.binaries=target/classes

sonar.modules=module1

module1.sonar.projectConfigFile=any-folder/generated/any-file.properties

+ 2
- 0
src/test/resources/org/sonar/runner/internal/batch/SonarProjectBuilderTest/multi-module-with-configfile/any-folder/any-file.properties 파일 보기

@@ -0,0 +1,2 @@
sonar.projectKey=com.foo.project.module1
sonar.projectName=Foo Module 1

+ 1
- 1
src/test/resources/org/sonar/runner/internal/batch/SonarProjectBuilderTest/multi-module-with-configfile/sonar-project.properties 파일 보기

@@ -9,4 +9,4 @@ sonar.binaries=target/classes

sonar.modules=module1

module1.sonar.projectConfigFile=any-folder/generated/any-file.properties
module1.sonar.projectConfigFile=any-folder/any-file.properties

Loading…
취소
저장