Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for getHasEmptyContent (0.23 sec)

  1. subprojects/core/src/test/groovy/org/gradle/configuration/BuildOperationScriptPluginTest.groovy

            1 * scriptSourceResource.getLocation() >> scriptSourceResourceLocation
            1 * scriptSourceResource.isContentCached() >> true
            1 * scriptSourceResource.getHasEmptyContent() >> false
            3 * decoratedScriptPlugin.getSource() >> scriptSource
            2 * scriptSource.shortDisplayName >> Describables.of("<test.source>")
            1 * decoratedScriptPlugin.apply(target)
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Fri Mar 08 13:46:07 UTC 2024
    - 3K bytes
    - Viewed (0)
  2. platforms/software/resources/src/test/groovy/org/gradle/internal/resource/DownloadedUriTextResourceTest.groovy

            then:
            underTest.getHasEmptyContent()
        }
    
        def "should have content when downloaded file has content"() {
            when:
            downloadedFile.text = "Some content"
            underTest = new DownloadedUriTextResource("Test description", sourceUri, "", downloadedFile, resolver)
    
            then:
            !underTest.getHasEmptyContent()
        }
    
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Oct 12 19:38:08 UTC 2023
    - 5.3K bytes
    - Viewed (0)
  3. platforms/software/resources/src/main/java/org/gradle/internal/resource/EmptyFileTextResource.java

            super(description, sourceFile, resolver);
        }
    
        @Override
        public boolean isContentCached() {
            return true;
        }
    
        @Override
        public boolean getHasEmptyContent() {
            return true;
        }
    
        @Override
        public File getFile() {
            // Returns null as there is no file that contains this resource's contents,
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Oct 12 19:38:08 UTC 2023
    - 2.2K bytes
    - Viewed (0)
  4. subprojects/core/src/test/groovy/org/gradle/groovy/scripts/TextResourceScriptSourceTest.java

            assertThat(source.getResource().getText(), equalTo("content"));
            assertFalse(source.getResource().isContentCached());
            assertFalse(source.getResource().getHasEmptyContent());
            assertTrue(source.getResource().getExists());
        }
    
        @Test
        public void convenienceMethodReplacesFileThatDoesNotExistWithEmptyScript() {
            ScriptSource source = forFile(scriptFile);
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Wed Feb 15 01:04:05 UTC 2023
    - 12K bytes
    - Viewed (0)
  5. platforms/software/resources/src/main/java/org/gradle/internal/resource/CachingTextResource.java

            try {
                maybeFetch();
            } catch (MissingResourceException e) {
                return false;
            }
            return true;
        }
    
        @Override
        public boolean getHasEmptyContent() {
            maybeFetch();
            return content.length() == 0;
        }
    
        @Override
        public String getText() {
            maybeFetch();
            return content;
        }
    
        @Override
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Oct 12 19:38:08 UTC 2023
    - 3K bytes
    - Viewed (0)
  6. platforms/software/resources/src/main/java/org/gradle/internal/resource/StringTextResource.java

            return getLongDisplayName();
        }
    
        @Override
        public boolean isContentCached() {
            return true;
        }
    
        @Override
        public boolean getHasEmptyContent() {
            return contents.length() == 0;
        }
    
        @Override
        public Reader getAsReader() {
            return new StringReader(getText());
        }
    
        @Override
        public String getText() {
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Oct 12 19:38:08 UTC 2023
    - 3.3K bytes
    - Viewed (0)
  7. subprojects/core/src/main/java/org/gradle/configuration/BuildOperationScriptPlugin.java

            return decorated.getSource();
        }
    
        @Override
        public void apply(final Object target) {
            TextResource resource = getSource().getResource();
            if (resource.isContentCached() && resource.getHasEmptyContent()) {
                //no operation, if there is no script code provided
                decorated.apply(target);
            } else {
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Fri Mar 08 13:46:07 UTC 2024
    - 5.5K bytes
    - Viewed (0)
  8. platforms/software/resources/src/main/java/org/gradle/internal/resource/TextResource.java

         *
         * @throws org.gradle.api.resources.MissingResourceException When this resource does not exist.
         * @throws ResourceException On failure to read content.
         */
        boolean getHasEmptyContent() throws ResourceException;
    
        /**
         * Returns an *unbuffered* reader over the content of this resource.
         *
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Oct 12 19:38:08 UTC 2023
    - 4.5K bytes
    - Viewed (0)
  9. platforms/software/resources/src/main/java/org/gradle/internal/resource/UriTextResource.java

            }
        }
    
        @Override
        public boolean isContentCached() {
            return false;
        }
    
        @Override
        public boolean getHasEmptyContent() {
            File file = getFile();
            if (file != null) {
                assertNoDirectory();
                if (!file.exists()) {
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Oct 12 19:38:08 UTC 2023
    - 11.8K bytes
    - Viewed (0)
  10. subprojects/core/src/main/java/org/gradle/groovy/scripts/internal/GroovyScriptClassCompiler.java

            final CompileOperation<M> operation,
            final Action<? super ClassNode> verifier
        ) {
            assert source.getResource().isContentCached();
            if (source.getResource().getHasEmptyContent()) {
                return new EmptyCompiledScript<>(operation);
            }
    
            String templateId = operation.getId();
            // TODO: Figure if execution engine should calculate the source hash on its own
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Tue Apr 16 15:23:24 UTC 2024
    - 23.5K bytes
    - Viewed (0)
Back to top