Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
58,000
Object (String modelName, Project project) { return null; }
buildAll
58,001
void ( @NotNull String modelName, @NotNull Project project, @NotNull ModelBuilderContext context, @NotNull Exception exception ) { context.getMessageReporter().createMessage() .withGroup("gradle.test.group") .withException(exception) .reportMessage(project); }
reportErrorMessage
58,002
boolean (String modelName) { return TestModelBuilderService_between_v_1_8_and_1_9_NotBase.class.getName().equals(modelName); }
canBuild
58,003
Object (String modelName, Project project) { return null; }
buildAll
58,004
void ( @NotNull String modelName, @NotNull Project project, @NotNull ModelBuilderContext context, @NotNull Exception exception ) { context.getMessageReporter().createMessage() .withGroup("gradle.test.group") .withException(exception) .reportMessage(project); }
reportErrorMessage
58,005
boolean (String version, Class<?> aClass) { final TargetVersions annotation = aClass.getAnnotation(TargetVersions.class); if (annotation == null) { return false; } return new VersionMatcher(GradleVersion.version(version)).isVersionMatch(annotation); }
isMatching
58,006
void (@NotNull String gradleVersion) { assumeTrue("Gradle [" + gradleVersion + "] cannot be execution on Java [" + JavaVersion.current() + "]", GradleJvmSupportMatrix.isSupported(GradleVersion.version(gradleVersion), JavaVersion.current())); if (GradleVersion.version(gradleVersion).getBaseVersion().compareTo(GradleVers...
assumeGradleCompatibleWithJava
58,007
boolean (Object item) { return item instanceof Integer && ((Integer)item).compareTo(9) < 0; }
matches
58,008
void () { if (testDir != null) { FileUtil.delete(testDir); } }
tearDown
58,009
void (String projectPath, String... classpath) { final Map<String, BuildScriptClasspathModel> classpathModelMap = getModulesMap(BuildScriptClasspathModel.class); final BuildScriptClasspathModel classpathModel = classpathModelMap.get(projectPath); assertNotNull(classpathModel); final List<? extends ClasspathEntryModel> ...
assertBuildClasspath
58,010
String (@NotNull GradleVersion version) { return version.isSnapshot() ? mySnapshotRepoUrl : myReleaseRepoUrl; }
getDistributionRepository
58,011
String (boolean isSnapshotUrl) { final String envRepoUrl = System.getenv(isSnapshotUrl ? SNAPSHOT_REPOSITORY_ENV : RELEASE_REPOSITORY_ENV); if (envRepoUrl != null) return envRepoUrl; if (UsefulTestCase.IS_UNDER_TEAMCITY) { return isSnapshotUrl ? INTELLIJ_LABS_GRADLE_SNAPSHOT_MIRROR : INTELLIJ_LABS_GRADLE_RELEASE_MIRROR...
getRepoUrl
58,012
boolean (String modelName) { return ProjectProperties.class.getName().equals(modelName); }
canBuild
58,013
Object (String modelName, Project project) { Map<String, String> propertiesMap = new LinkedHashMap<>(); for (Map.Entry<String, ?> entry : project.getProperties().entrySet()) { propertiesMap.put(entry.getKey(), Objects.toString(entry.getValue(), null)); } return new ProjectPropertiesImpl(propertiesMap); }
buildAll
58,014
void ( @NotNull String modelName, @NotNull Project project, @NotNull ModelBuilderContext context, @NotNull Exception exception ) { context.getMessageReporter().createMessage() .withGroup("gradle.test.group") .withKind(Message.Kind.ERROR) .withTitle("Test model import errors") .withText("Unable to import Test model") .w...
reportErrorMessage
58,015
void () { DomainObjectSet<? extends IdeaModule> ideaModules = allModels.getModel(IdeaProject.class).getModules(); List<BuildScriptClasspathModel> ideaModule = ContainerUtil.mapNotNull(ideaModules, module -> { BuildScriptClasspathModel classpathModel = allModels.getModel(module, BuildScriptClasspathModel.class); if (mod...
testModelBuildScriptClasspathBuilder
58,016
boolean (String modelName) { return Model.class.getName().equals(modelName); }
canBuild
58,017
Object (String modelName, Project project) { throw new RuntimeException("Boom! '\"{}}
buildAll
58,018
void ( @NotNull String modelName, @NotNull Project project, @NotNull ModelBuilderContext context, @NotNull Exception exception ) { context.getMessageReporter().createMessage() .withGroup("gradle.test.group") .withKind(Message.Kind.ERROR) .withTitle("Test import errors") .withText("Unable to import Test model") .withExc...
reportErrorMessage
58,019
void () { DomainObjectSet<? extends IdeaModule> ideaModules = allModels.getModel(IdeaProject.class).getModules(); List<ScalaModel> scalaModels = ContainerUtil.mapNotNull(ideaModules, module -> allModels.getModel(module, ScalaModel.class)); assertEquals(1, scalaModels.size()); ScalaModel scalaModel = scalaModels.get(0);...
testScalaModel
58,020
void () { DomainObjectSet<? extends IdeaModule> ideaModules = allModels.getModel(IdeaProject.class).getModules(); List<WebConfiguration> ideaModule = ContainerUtil.mapNotNull(ideaModules, module -> allModels.getModel(module, WebConfiguration.class)); assertEquals(1, ideaModule.size()); WebConfiguration webConfiguration...
testDefaultWarModel
58,021
ProjectIdentifier (@NotNull Project project) { return new InternalProjectIdentifier(project.getRootDir(), project.getPath()); }
getProjectIdentifier
58,022
void (@NotNull Runnable runnable) { runOrRetryOnce(() -> { runnable.run(); return null; }); }
runOrRetryOnce
58,023
boolean (@NotNull Project project) { // this is necessary for the explicit 'Download sources' action, and also to ensure that sources can be disabled for the headless idea // regardless of user settings String forcePropertyValue = System.getProperty(DOWNLOAD_SOURCES_FORCE_PROPERTY_NAME); if (forcePropertyValue != null)...
shouldDownloadSources
58,024
boolean (@NotNull Project project) { IdeaPlugin ideaPlugin = findIdeaPlugin(project); if (ideaPlugin != null) { final IdeaModule ideaModule = ideaPlugin.getModel().getModule(); return ideaModule.isDownloadJavadoc(); } return false; }
shouldDownloadJavadoc
58,025
void (@NotNull Project project, boolean downloadSources, boolean downloadJavadocs) { project.getPlugins() .withType(IdeaPlugin.class, plugin -> { IdeaModule module = plugin.getModel().getModule(); module.setDownloadSources(downloadSources); module.setDownloadJavadoc(downloadJavadocs); }); }
setPolicy
58,026
boolean (@NotNull Task task, @NotNull String propertyName, boolean defaultValue) { Object value = getProperty(task, propertyName); if (value == null) { return defaultValue; } return Boolean.parseBoolean(value.toString()); }
getBooleanProperty
58,027
JavaPluginConvention () { return myProject.getConvention().findPlugin(JavaPluginConvention.class); }
getJavaPluginConvention
58,028
SourceSetContainer () { final JavaPluginConvention convention = getJavaPluginConvention(); return (convention == null ? null : convention.getSourceSets()); }
getSourceSetContainer
58,029
String () { JavaPluginConvention javaPluginConvention = getJavaPluginConvention(); if (javaPluginConvention == null) return null; return javaPluginConvention.getTargetCompatibility().toString(); }
getTargetCompatibility
58,030
String () { JavaPluginConvention javaPluginConvention = getJavaPluginConvention(); if (javaPluginConvention == null) return null; return javaPluginConvention.getSourceCompatibility().toString(); }
getSourceCompatibility
58,031
boolean () { return getJavaPluginConvention() != null; }
isJavaPluginApplied
58,032
JavaPluginAccessor (@NotNull Project p) { if (is82OrBetter) { return new ExtensionJavaPluginAccessor(p); } else { return new ConventionJavaPluginAccessor(p); } }
getJavaPluginAccessor
58,033
boolean (Project project) { return getJavaPluginAccessor(project).isJavaPluginApplied(); }
isJavaPluginApplied
58,034
JavaPluginExtension () { return myProject.getExtensions().findByType(JavaPluginExtension.class); }
getJavaPluginExtension
58,035
SourceSetContainer () { JavaPluginExtension javaExtension = getJavaPluginExtension(); if (javaExtension != null) { return javaExtension.getSourceSets(); } return null; }
getSourceSetContainer
58,036
String () { JavaPluginExtension javaExtension = getJavaPluginExtension(); if (javaExtension != null) { return javaExtension.getTargetCompatibility().toString(); } return null; }
getTargetCompatibility
58,037
String () { JavaPluginExtension javaExtension = getJavaPluginExtension(); if (javaExtension != null) { return javaExtension.getSourceCompatibility().toString(); } return null; }
getSourceCompatibility
58,038
boolean () { return getJavaPluginExtension() != null; }
isJavaPluginApplied
58,039
MessageReportBuilder (String title) { myTitle = title; return this; }
withTitle
58,040
MessageReportBuilder (String text) { myText = text; return this; }
withText
58,041
MessageReportBuilder (Message.Kind kind) { myKind = kind; return this; }
withKind
58,042
MessageReportBuilder (String group) { myGroup = group; return this; }
withGroup
58,043
MessageReportBuilder (Exception e) { myException = e; return this; }
withException
58,044
MessageReportBuilder () { myException = new IllegalStateException(); return this; }
withStackTrace
58,045
MessageReportBuilder (String filePath, int line, int column) { myFilePosition = new Message.FilePosition(filePath, line, column); return this; }
withLocation
58,046
void (@NotNull Project project) { myMessageReporter.reportMessage(project, new DefaultMessageBuilder() .withTitle(myTitle) .withText(myText) .withKind(myKind) .withGroup(myGroup) .withException(myException) .withLocation(myFilePosition) .withProject(project) .build() ); }
reportMessage
58,047
MessageReportBuilder () { return new DefaultMessageReportBuilder(this); }
createMessage
58,048
void (@NotNull Project project, @NotNull Message message) { try { if (project instanceof DefaultProject) { reportMessageByProgressLogger((DefaultProject)project, message); } else { reportMessageByGlobalLogger(message); } } catch (Throwable e) { LOG.warn("Failed to report model builder message", e); } }
reportMessage
58,049
void (@NotNull DefaultProject project, @NotNull Message message) { ProgressLoggerFactory progressLoggerFactory = project.getServices().get(ProgressLoggerFactory.class); ProgressLogger operation = progressLoggerFactory.newOperation(ModelBuilderService.class); String jsonMessage = new GsonBuilder().create().toJson(messag...
reportMessageByProgressLogger
58,050
void (@NotNull Message message) { switch (message.getKind()) { case ERROR: LOG.error(message.getText()); break; case WARNING: LOG.warn(message.getText()); break; case INFO: LOG.info(message.getText()); break; } }
reportMessageByGlobalLogger
58,051
Gradle () { return myGradle; }
getGradle
58,052
MessageReporter () { return myMessageReporter; }
getMessageReporter
58,053
boolean (@NotNull String modelName) { if (DummyModel.class.getName().equals(modelName)) return true; if (TurnOffDefaultTasks.class.getName().equals(modelName)) return true; for (ModelBuilderService service : modelBuilderServices) { if (service.canBuild(modelName)) return true; } return false; }
canBuild
58,054
void (@NotNull Project project) { StartParameter startParameter = project.getGradle().getStartParameter(); List<String> taskNames = startParameter.getTaskNames(); if (taskNames.isEmpty()) { startParameter.setTaskNames(null); List<String> helpTask = Collections.singletonList("help"); project.setDefaultTasks(helpTask); s...
turnOffDefaultTasks
58,055
void ( @NotNull Project project, @NotNull ModelBuilderService service, @NotNull String modelName, long timeInMs ) { String projectName = GradleNegotiationUtil.getProjectDisplayName(project); String serviceName = service.getClass().getSimpleName(); String msg = String.format("%s: service %s imported '%s' in %d ms", proj...
reportPerformanceStatistic
58,056
RuntimeException (@NotNull Exception exception) { if (exception instanceof RuntimeException) { return (RuntimeException)exception; } return new ExternalSystemException(exception); }
asRuntimeException
58,057
Gradle (@NotNull Gradle gradle) { Gradle root = gradle; while (root.getParent() != null) { root = root.getParent(); } return root; }
getRootGradle
58,058
GradleModelFetchPhase () { return GradleModelFetchPhase.PROJECT_MODEL_PHASE; }
getPhase
58,059
void ( @NotNull BuildController controller, @NotNull GradleBuild buildModel, @NotNull BuildModelConsumer consumer ) { Map<BasicGradleProject, PartialExternalProject> externalProjectMap = collectExternalProjects(controller, buildModel); PartialExternalProject rootExternalProject = buildExternalProjectHierarchy(buildMode...
populateBuildModels
58,060
void (@NotNull Map<String, PartialExternalProject> childProjects) { this.childProjects = childProjects; }
setChildProjects
58,061
String () { return externalProject.getExternalSystemId(); }
getExternalSystemId
58,062
String () { return externalProject.getId(); }
getId
58,063
String () { return externalProject.getPath(); }
getPath
58,064
String () { return externalProject.getIdentityPath(); }
getIdentityPath
58,065
String () { return externalProject.getName(); }
getName
58,066
String () { return externalProject.getQName(); }
getQName
58,067
String () { return externalProject.getGroup(); }
getGroup
58,068
String () { return externalProject.getVersion(); }
getVersion
58,069
File () { return externalProject.getProjectDir(); }
getProjectDir
58,070
File () { return externalProject.getBuildDir(); }
getBuildDir
58,071
List<File> () { return externalProject.getArtifacts(); }
getArtifacts
58,072
GradleSourceSetModel () { return externalProject.getSourceSetModel(); }
getSourceSetModel
58,073
boolean (@NotNull String modelName) { return ExternalProject.class.getName().equals(modelName) || ExternalProjectPreview.class.getName().equals(modelName); }
canBuild
58,074
DefaultExternalProject ( @NotNull Project project, @NotNull ModelBuilderContext context ) { String projectPath = project.getPath(); String projectName = project.getName(); String projectIdentityPath = GradleObjectUtil.notNull(getProjectIdentityPath(project), projectPath); String ideaModuleName = GradleObjectUtil.notNul...
buildExternalProject
58,075
DefaultGradleSourceSetModel ( @NotNull Project project, @NotNull ModelBuilderContext context ) { return GradleSourceSetCache.getInstance(context) .getSourceSetModel(project); }
getSourceSetModel
58,076
String (@Nullable Object o) { return o instanceof CharSequence ? o.toString() : ""; }
wrap
58,077
void ( @NotNull String modelName, @NotNull Project project, @NotNull ModelBuilderContext context, @NotNull Exception exception ) { context.getMessageReporter().createMessage() .withGroup(Messages.PROJECT_MODEL_GROUP) .withKind(Message.Kind.ERROR) .withTitle("Project resolution failure") .withText("Unable to resolve add...
reportErrorMessage
58,078
void (@Nullable String sourceCompatibility) { this.sourceCompatibility = sourceCompatibility; }
setSourceCompatibility
58,079
void (@Nullable String targetCompatibility) { this.targetCompatibility = targetCompatibility; }
setTargetCompatibility
58,080
List<File> () { return taskArtifacts; }
getTaskArtifacts
58,081
void (@NotNull List<File> taskArtifacts) { this.taskArtifacts = taskArtifacts; }
setTaskArtifacts
58,082
void (@NotNull Map<String, Set<File>> configurationArtifacts) { this.configurationArtifacts = configurationArtifacts; }
setConfigurationArtifacts
58,083
void (@NotNull Map<String, DefaultExternalSourceSet> sourceSets) { this.sourceSets = sourceSets; }
setSourceSets
58,084
void (@NotNull List<File> additionalArtifacts) { this.additionalArtifacts = additionalArtifacts; }
setAdditionalArtifacts
58,085
List<File> (@NotNull Collection<? extends File> artifactFiles) { List<File> artifactSources = new ArrayList<>(); for (File artifactFile : artifactFiles) { artifactSources.addAll(findSourcesByArtifact(artifactFile.getPath())); } return artifactSources; }
findArtifactSources
58,086
Set<File> (@NotNull String path) { if (!mySourceMap.containsKey(path)) { SourceSet sourceSet = myArtifactsMap.myArtifactsMap.get(path); if (sourceSet != null) { Set<File> sources = sourceSet.getAllJava().getSrcDirs(); Set<File> calculatedSources = mySourceMap.putIfAbsent(path, sources); return calculatedSources != null...
findSourcesByArtifact
58,087
ArtifactsMap (@NotNull ModelBuilderContext context) { Gradle gradle = context.getGradle(); Map<String, SourceSet> artifactsMap = new HashMap<>(); Map<String, String> sourceSetOutputDirsToArtifactsMap = new HashMap<>(); List<Project> projects = new ArrayList<>(gradle.getRootProject().getAllprojects()); boolean isComposi...
createArtifactsMap
58,088
List<Project> (@NotNull Gradle gradle) { List<Project> result = new ArrayList<>(); for (IncludedBuild includedBuild : gradle.getIncludedBuilds()) { Object unwrapped = maybeUnwrapIncludedBuildInternal(includedBuild); if (unwrapped instanceof DefaultIncludedBuild) { DefaultIncludedBuild build = (DefaultIncludedBuild)unwr...
exposeIncludedBuilds
58,089
Set<Project> (@NotNull DefaultIncludedBuild build) { GradleInternal gradleInternal = GradleReflectionUtil.reflectiveCall(build, "getConfiguredBuild", GradleInternal.class); return gradleInternal.getRootProject().getAllprojects(); }
getProjectsWithReflection
58,090
Object (@NotNull IncludedBuild includedBuild) { Class<?> includedBuildInternalClass = GradleReflectionUtil.findClassForName("org.gradle.internal.composite.IncludedBuildInternal"); if (includedBuildInternalClass != null && includedBuildInternalClass.isAssignableFrom(includedBuild.getClass())) { return GradleReflectionUt...
maybeUnwrapIncludedBuildInternal
58,091
GradleSourceSetCachedFinder (@NotNull ModelBuilderContext context) { return context.getData(INSTANCE_PROVIDER); }
getInstance
58,092
DefaultGradleSourceSetModel (@NotNull Project project) { ProjectIdentifier projectIdentifier = GradleProjectUtil.getProjectIdentifier(project); DefaultGradleSourceSetModel sourceSetModel = allSourceSetModels.get(projectIdentifier); if (sourceSetModel == null) { context.getMessageReporter().createMessage() .withGroup(Me...
getSourceSetModel
58,093
void (@NotNull Project project, @NotNull DefaultGradleSourceSetModel sourceSetModel) { ProjectIdentifier projectIdentifier = GradleProjectUtil.getProjectIdentifier(project); DefaultGradleSourceSetModel previousSourceSetModel = allSourceSetModels.put(projectIdentifier, sourceSetModel); if (previousSourceSetModel != null...
setSourceSetModel
58,094
void (@NotNull Project project) { ProjectIdentifier projectIdentifier = GradleProjectUtil.getProjectIdentifier(project); allSourceSetModels.put(projectIdentifier, new DefaultGradleSourceSetModel()); }
markSourceSetModelAsError
58,095
GradleSourceSetCache (@NotNull ModelBuilderContext context) { return context.getData(INSTANCE_PROVIDER); }
getInstance
58,096
GradleModelFetchPhase () { return GradleModelFetchPhase.PROJECT_SOURCE_SET_PHASE; }
getPhase
58,097
void ( @NotNull BuildController controller, @NotNull GradleBuild buildModel, @NotNull BuildModelConsumer consumer ) { GradleModelProviderUtil.buildModels(controller, buildModel.getProjects(), GradleSourceSetModel.class); }
populateBuildModels
58,098
List<String> () { return configurations; }
getConfigurations
58,099
void (List<String> configurations) { this.configurations = configurations; }
setConfigurations