GVKun编程网logo

在PyInstaller中将.onefile与.spec一起使用(pyinstaller an integer is)

9

在本文中,我们将给您介绍关于在PyInstaller中将.onefile与.spec一起使用的详细内容,并且为您解答pyinstalleranintegeris的相关问题,此外,我们还将为您提供关于

在本文中,我们将给您介绍关于在PyInstaller中将.onefile与.spec一起使用的详细内容,并且为您解答pyinstaller an integer is的相关问题,此外,我们还将为您提供关于【解决】MacOS 下 Python3.7 使用 pyinstaller 打包后执行报错 Failed to execute script pyi_rth__tkinter、asp.net-mvc – 在ControllerInstanceFilterProvider的Filters之前运行的GlobalFilterCollection的过滤器、org.gradle.api.internal.file.collections.DefaultConfigurableFileCollection的实例源码、org.gradle.api.internal.file.collections.SimpleFileCollection的实例源码的知识。

本文目录一览:

在PyInstaller中将.onefile与.spec一起使用(pyinstaller an integer is)

在PyInstaller中将.onefile与.spec一起使用(pyinstaller an integer is)

我正在使用.spec文件使用PyInstaller“编译”程序。我正在使用.spec文件,因为我需要在程序中包括一个额外的文件。当我尝试这样做时PyInstaller--onefileProg.spec,它仍然将dist所有文件分开放置在一个文件夹中,而不是像我期望的那样制作一个文件。如果我这样做,PyInstaller--onefile Prog.py则确实会在dist其中创建一个.exe文件,这就是我想要的。使用.spec文件时,我需要做些特别的事情吗?

答案1

小编典典

您可以在命令行上添加其他文件,而不用编辑规范文件:

pyinstaller --onefile --add-data <SRC;DEST or SRC:DEST> yourfile.py

否则,请确保在规格文件中没有收集步骤:

“在单文件模式下,没有对COLLECT的调用,并且EXE实例接收所有脚本,模块和二进制文件。”

https://pyinstaller.readthedocs.io/en/stable/usage.html,以获取有关命令行标志的更多信息。

【解决】MacOS 下 Python3.7 使用 pyinstaller 打包后执行报错 Failed to execute script pyi_rth__tkinter

【解决】MacOS 下 Python3.7 使用 pyinstaller 打包后执行报错 Failed to execute script pyi_rth__tkinter

Fix tcl/tk libs inclusion in tkinter with Python3.7 under MacOS

使用 Pyinstaller 打包时候报错 

3027 ERROR: Tcl/Tk improperly installed on this system.
(lyj_venv) ➜ liyongjiandeMBP.lan [/Users/liyongjian/lyj] pyinstaller --windowed --onefile --clean --noconfirm ServenDigitsDrawV2.py
77 INFO: PyInstaller: 3.4
77 INFO: Python: 3.7.3
84 INFO: Platform: Darwin-18.5.0-x86_64-i386-64bit
85 INFO: wrote /Users/liyongjian/lyj/ServenDigitsDrawV2.spec
88 INFO: UPX is not available.
89 INFO: Removing temporary files and cleaning cache in /Users/liyongjian/Library/Application Support/pyinstaller
96 INFO: Extending PYTHONPATH with paths
[''/Users/liyongjian/lyj'', ''/Users/liyongjian/lyj'']
96 INFO: checking Analysis
96 INFO: Building Analysis because Analysis-00.toc is non existent
96 INFO: Initializing module dependency graph...
97 INFO: Initializing module graph hooks...
99 INFO: Analyzing base_library.zip ...
2805 INFO: running Analysis Analysis-00.toc
2814 INFO: Caching module hooks...
2817 INFO: Analyzing /Users/liyongjian/lyj/ServenDigitsDrawV2.py
3015 INFO: Loading module hooks...
3015 INFO: Loading module hook "hook-_tkinter.py"...
3027 ERROR: Tcl/Tk improperly installed on this system.
3027 INFO: Loading module hook "hook-encodings.py"...
3086 INFO: Loading module hook "hook-xml.py"...
3281 INFO: Loading module hook "hook-pydoc.py"...
3292 INFO: Looking for ctypes DLLs
3292 INFO: Analyzing run-time hooks ...
3295 INFO: Including run-time hook ''pyi_rth__tkinter.py''
3303 INFO: Looking for dynamic libraries
3411 INFO: Looking for eggs
3411 INFO: Using Python library /Library/Frameworks/Python.framework/Versions/3.7/Python
3413 INFO: Warnings written to /Users/liyongjian/lyj/build/ServenDigitsDrawV2/warn-ServenDigitsDrawV2.txt
3439 INFO: Graph cross-reference written to /Users/liyongjian/lyj/build/ServenDigitsDrawV2/xref-ServenDigitsDrawV2.html
3446 INFO: checking PYZ
3446 INFO: Building PYZ because PYZ-00.toc is non existent
3447 INFO: Building PYZ (ZlibArchive) /Users/liyongjian/lyj/build/ServenDigitsDrawV2/PYZ-00.pyz
3756 INFO: Building PYZ (ZlibArchive) /Users/liyongjian/lyj/build/ServenDigitsDrawV2/PYZ-00.pyz completed successfully.
3760 INFO: checking PKG
3760 INFO: Building PKG because PKG-00.toc is non existent
3760 INFO: Building PKG (CArchive) PKG-00.pkg
6336 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully.
6339 INFO: Bootloader /Users/liyongjian/lyj/lyj_venv/lib/python3.7/site-packages/PyInstaller/bootloader/Darwin-64bit/runw
6339 INFO: checking EXE
6339 INFO: Building EXE because EXE-00.toc is non existent
6339 INFO: Building EXE from EXE-00.toc
6339 INFO: Appending archive to EXE /Users/liyongjian/lyj/dist/ServenDigitsDrawV2
6346 INFO: Fixing EXE for code signing /Users/liyongjian/lyj/dist/ServenDigitsDrawV2
6352 INFO: Building EXE from EXE-00.toc completed successfully.
6354 INFO: checking BUNDLE
6354 INFO: Building BUNDLE because BUNDLE-00.toc is non existent
6354 INFO: Building BUNDLE BUNDLE-00.toc
6366 INFO: moving BUNDLE data files to Resource directory

执行的时候报错

➜ liyongjiandeMBP.lan [/Users/liyongjian] /Users/liyongjian/lyj/dist/ServenDigitsDrawV2 ; exit;
Traceback (most recent call last):
File "PyInstaller/loader/rthooks/pyi_rth__tkinter.py", line 28, in <module>
FileNotFoundError: Tcl data directory "/var/folders/f9/6m090zhs6w55rmbmhkmpff440000gn/T/_MEITVlJln/tcl" not found.
[39503] Failed to execute script pyi_rth__tkinter

[进程已完成]

解决办法:

在文件中增加 

and ''Python'' not in path_to_tcl
PyInstaller/hooks/hook-_tkinter.py
@@ -180,7 +180,7 @@ def _find_tcl_tk(hook_api):
180
181   # _tkinter depends on Tcl/Tk compiled as frameworks.
182   path_to_tcl = bins[0][1]
    - if ''Library/Frameworks'' in path_to_tcl:
183 + if ''Library/Frameworks'' in path_to_tcl and ''Python'' not in path_to_tcl:

 

参考链接:https://github.com/pyinstaller/pyinstaller/pull/3830
               https://stackoverflow.com/questions/51847801/pyinstaller-app-not-opening-on-mac

asp.net-mvc – 在ControllerInstanceFilterProvider的Filters之前运行的GlobalFilterCollection的过滤器

asp.net-mvc – 在ControllerInstanceFilterProvider的Filters之前运行的GlobalFilterCollection的过滤器

我遇到了一个奇怪的行为,但我不确定我是否在这里正确的轨道.

我有一个控制器,它覆盖了Controller基类的OnException方法.

public class ControllerFiltersController : Controller {

    public ActionResult Index() {

        throw new NotImplementedException();
    }

    protected override void OnException(ExceptionContext filterContext) {

        Trace.Traceinformation(
            "ControllerFiltersController Exception: " + DateTime.Now.ToString("hh:mm:ss.fff")
        );
    }
}

我还有一个自定义的ExceptionFilter,如下所示:

public class HandleErrorCustom : IExceptionFilter {

    public void OnException(ExceptionContext filterContext) {

        Trace.Traceinformation(
            "HandleErrorCustom Exception Message: " + DateTime.Now.ToString("hh:mm:ss.fff")
        );
    }
}

然后,我将其注册为全局过滤器:

public static void RegisterGlobalFilters(GlobalFilterCollection filters) {

    filters.Add(new HandleErrorCustom());
}

我期望控制器实例过滤器在全局过滤器之前运行,因为ControllerInstanceFilterProvider提供的过滤器顺序是Int32.MinValue,它们的范围是FilterScope.First.

正如此处所述:ASP.NET MVC 3 Service Location,Part 4: Filters

但结果却不同:

iisexpress.exe information: 0 : HandleErrorCustom Exception Message:
06:56:49.972

iisexpress.exe information: 0 : ControllerFiltersController Exception:
06:56:49.974

这是一个ASP.NET MVC 4应用程序,我不知道任何影响ASP.NET MVC 3的过滤器排序行为的更改.我在这里缺少什么?

解决方法

这是预期的行为.

过滤器排序取决于信息流动的方向.如果信息流入动作,那么订单就像您期望的那样;如果信息流回动作,那么订单将被撤销.

例如,假设您按此顺序有三个过滤器:F1,F2,F3.假设这些是动作过滤器(意思是,它们正在侦听ActionExecuting和ActionExecuted).系统将运行它们的顺序如下:

F1.ActionExecuting()
F2.ActionExecuting()
F3.ActionExecuting()
Action()
F3.ActionExecuted()
F2.ActionExecuted()
F1.ActionExecuted()

根据定义,错误处理程序是在操作的返回端运行的过滤器,因此它们的顺序是相反的.

org.gradle.api.internal.file.collections.DefaultConfigurableFileCollection的实例源码

org.gradle.api.internal.file.collections.DefaultConfigurableFileCollection的实例源码

项目:Reer    文件:JvmOptions.java   
public JvmOptions(PathToFileResolver resolver) {
    this.bootstrapClasspath = new DefaultConfigurableFileCollection(resolver,null);
    immutableSystemProperties.put(FILE_ENCODING_KEY,Charset.defaultCharset().name());
    immutableSystemProperties.put(USER_LANGUAGE_KEY,DEFAULT_LOCALE.getLanguage());
    immutableSystemProperties.put(USER_COUNTRY_KEY,DEFAULT_LOCALE.getCountry());
    immutableSystemProperties.put(USER_VARIANT_KEY,DEFAULT_LOCALE.getvariant());
}
项目:Reer    文件:JavaExecHandleBuilder.java   
public JavaExecHandleBuilder(FileResolver fileResolver) {
    super(fileResolver);
    this.fileResolver = fileResolver;
    javaoptions = new DefaultJavaForkOptions(fileResolver);
    classpath = new DefaultConfigurableFileCollection(fileResolver,null);
    executable(javaoptions.getExecutable());
}
项目:Reer    文件:DefaultSourceSetoutput.java   
public DefaultSourceSetoutput(String sourceSetdisplayName,FileResolver fileResolver,TaskResolver taskResolver) {
    this.fileResolver = fileResolver;
    String displayName = sourceSetdisplayName + " classes";
    outputDirectories = new DefaultConfigurableFileCollection(displayName,fileResolver,taskResolver,new Callable() {
        public Object call() throws Exception {
            return getClassesDir();
        }
    },new Callable() {
        public Object call() throws Exception {
            return getResourcesDir();
        }
    });
    dirs = new DefaultConfigurableFileCollection("dirs",taskResolver);
}
项目:intellij-ce-playground    文件:TaskManager.java   
private static void fixTestTaskSources(@NonNull Test testTask) {
    // We are running in afterEvaluate,so the JavaBasePlugin has already added a
    // callback to add test classes to the list of source files of the newly created task.
    // The problem is that we haven't configured the test classes yet (JavaBasePlugin
    // assumes all Test tasks are fully configured at this point),so we have to remove the
    // "directory null" entry from source files and add the right value.
    //
    // This is an ugly hack,since we assume sourceFiles is an instance of
    // DefaultConfigurableFileCollection.
    ((DefaultConfigurableFileCollection) testTask.getInputs().getSourceFiles()).getFrom().clear();
}
项目:Pushjet-Android    文件:JvmOptions.java   
public JvmOptions(FileResolver resolver) {
    this.bootstrapClasspath = new DefaultConfigurableFileCollection(resolver,DEFAULT_LOCALE.getvariant());
}
项目:Pushjet-Android    文件:JavaExecHandleBuilder.java   
public JavaExecHandleBuilder(FileResolver fileResolver) {
    super(fileResolver);
    this.fileResolver = fileResolver;
    javaoptions = new DefaultJavaForkOptions(fileResolver);
    classpath = new DefaultConfigurableFileCollection(fileResolver,null);
    executable(javaoptions.getExecutable());
}
项目:Pushjet-Android    文件:DefaultSourceSetoutput.java   
public DefaultSourceSetoutput(String sourceSetdisplayName,TaskResolver taskResolver) {
    this.fileResolver = fileResolver;
    String displayName = String.format("%s output",sourceSetdisplayName);
    outputDirectories = new DefaultConfigurableFileCollection(displayName,taskResolver);
}
项目:Reer    文件:DefaultClasspath.java   
public DefaultClasspath(FileResolver fileResolver,TaskResolver taskResolver) {
    files = new DefaultConfigurableFileCollection(fileResolver,taskResolver);
}
项目:Reer    文件:AbstractFileResolver.java   
public FileCollectionInternal resolveFiles(Object... paths) {
    if (paths.length == 1 && paths[0] instanceof FileCollection) {
        return Cast.cast(FileCollectionInternal.class,paths[0]);
    }
    return new DefaultConfigurableFileCollection(this,null,paths);
}
项目:Reer    文件:DefaultFileOperations.java   
public ConfigurableFileCollection files(Object... paths) {
    return new DefaultConfigurableFileCollection(fileResolver,paths);
}
项目:Pushjet-Android    文件:DefaultClasspath.java   
public DefaultClasspath(FileResolver fileResolver,taskResolver);
}
项目:Pushjet-Android    文件:DefaultTaskInputs.java   
public DefaultTaskInputs(FileResolver resolver,TaskInternal task,TaskMutator taskMutator) {
    this.resolver = resolver;
    this.taskMutator = taskMutator;
    inputFiles = new DefaultConfigurableFileCollection(String.format("%s input files",task),resolver,null);
    sourceFiles = new DefaultConfigurableFileCollection(String.format("%s source files",null);
}
项目:Pushjet-Android    文件:DefaultTaskOutputs.java   
public DefaultTaskOutputs(FileResolver resolver,TaskMutator taskMutator) {
    this.taskMutator = taskMutator;
    outputFiles = new DefaultConfigurableFileCollection(String.format("%s output files",null);
    outputFiles.builtBy(task);
}
项目:Pushjet-Android    文件:AbstractFileResolver.java   
public FileCollection resolveFiles(Object... paths) {
    if (paths.length == 1 && paths[0] instanceof FileCollection) {
        return (FileCollection) paths[0];
    }
    return new DefaultConfigurableFileCollection(this,paths);
}
项目:Pushjet-Android    文件:DefaultFileOperations.java   
public ConfigurableFileCollection files(Object... paths) {
    return new DefaultConfigurableFileCollection(fileResolver,paths);
}
项目:Pushjet-Android    文件:DefaultTaskInputs.java   
public DefaultTaskInputs(FileResolver resolver,TaskStatusNagger taskStatusNagger) {
    this.resolver = resolver;
    this.taskStatusNagger = taskStatusNagger;
    inputFiles = new DefaultConfigurableFileCollection(String.format("%s input files",TaskStatusNagger taskStatusNagger) {
    this.taskStatusNagger = taskStatusNagger;
    outputFiles = new DefaultConfigurableFileCollection(String.format("%s output files",null);
    outputFiles.builtBy(task);
}
项目:Pushjet-Android    文件:JvmOptions.java   
public JvmOptions(FileResolver resolver) {
    this.bootstrapClasspath = new DefaultConfigurableFileCollection(resolver,Charset.defaultCharset().name());
}

org.gradle.api.internal.file.collections.SimpleFileCollection的实例源码

org.gradle.api.internal.file.collections.SimpleFileCollection的实例源码

项目:Reer    文件:normalizingGroovyCompiler.java   
private void resolveAndFilterSourceFiles(final GroovyJavaJointCompileSpec spec) {
    final List<String> fileExtensions = CollectionUtils.collect(spec.getGroovyCompileOptions().getFileExtensions(),new Transformer<String,String>() {
        @Override
        public String transform(String extension) {
            return '.' + extension;
        }
    });
    FileCollection filtered = spec.getSource().filter(new Spec<File>() {
        public boolean isSatisfiedBy(File element) {
            for (String fileExtension : fileExtensions) {
                if (hasExtension(element,fileExtension)) {
                    return true;
                }
            }
            return false;
        }
    });

    spec.setSource(new SimpleFileCollection(filtered.getFiles()));
}
项目:Reer    文件:IncrementalCompilationInitializer.java   
public void initializeCompilation(JavaCompileSpec spec,Collection<String> staleClasses) {
    if (staleClasses.isEmpty()) {
        spec.setSource(new SimpleFileCollection());
        return; //do nothing. No classes need recompilation.
    }

    Factory<PatternSet> patternSetFactory = fileOperations.getFileResolver().getPatternSetFactory();
    PatternSet classesToDelete = patternSetFactory.create();
    PatternSet sourcetoCompile = patternSetFactory.create();

    preparePatterns(staleClasses,classesToDelete,sourcetoCompile);

    //selectively configure the source
    spec.setSource(spec.getSource().getAsfiletree().matching(sourcetoCompile));
    //since we're compiling selectively we need to include the classes compiled prevIoUsly
    spec.setClasspath(Iterables.concat(spec.getClasspath(),asList(spec.getDestinationDir())));
    //get rid of stale files
    filetree deleteMe = fileOperations.filetree(spec.getDestinationDir()).matching(classesToDelete);
    fileOperations.delete(deleteMe);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:BootRunTask.java   
private void addResourcesIfNecessary() {
    if (this.addResources) {
        SourceSet mainSourceSet = SourceSets.findMainSourceSet(getProject());
        final File outputDir = (mainSourceSet == null ? null
                : mainSourceSet.getoutput().getResourcesDir());
        final Set<File> resources = new LinkedHashSet<File>();
        if (mainSourceSet != null) {
            resources.addAll(mainSourceSet.getResources().getSrcDirs());
        }
        List<File> classpath = new ArrayList<File>(getClasspath().getFiles());
        classpath.addAll(0,resources);
        getLogger().info("Adding classpath: " + resources);
        setClasspath(new SimpleFileCollection(classpath));
        if (outputDir != null) {
            for (File directory : resources) {
                FileUtils.removeDuplicatesFromOutputDirectory(outputDir,directory);
            }
        }
    }
}
项目:spring-boot-concourse    文件:BootRunTask.java   
private void addResourcesIfNecessary() {
    if (this.addResources) {
        SourceSet mainSourceSet = SourceSets.findMainSourceSet(getProject());
        final File outputDir = (mainSourceSet == null ? null
                : mainSourceSet.getoutput().getResourcesDir());
        final Set<File> resources = new LinkedHashSet<File>();
        if (mainSourceSet != null) {
            resources.addAll(mainSourceSet.getResources().getSrcDirs());
        }
        List<File> classpath = new ArrayList<File>(getClasspath().getFiles());
        classpath.addAll(0,directory);
            }
        }
    }
}
项目:contestparser    文件:BootRunTask.java   
private void addResourcesIfNecessary() {
    if (this.addResources) {
        SourceSet mainSourceSet = SourceSets.findMainSourceSet(getProject());
        final File outputDir = (mainSourceSet == null ? null
                : mainSourceSet.getoutput().getResourcesDir());
        final Set<File> resources = new LinkedHashSet<File>();
        if (mainSourceSet != null) {
            resources.addAll(mainSourceSet.getResources().getSrcDirs());
        }
        List<File> classpath = new ArrayList<File>(getClasspath().getFiles());
        classpath.addAll(0,directory);
            }
        }
    }
}
项目:goomph    文件:JavaExecableImp.java   
static FileCollection fromLocalClassloader() {
    Set<File> files = new LinkedHashSet<>();
    Consumer<Class<?>> addPeerClasses = clazz -> {
        urlclassloader urlclassloader = (urlclassloader) clazz.getClassLoader();
        for (URL url : urlclassloader.getURLs()) {
            String name = url.getFile();
            if (name != null) {
                files.add(new File(name));
            }
        }
    };
    // add the classes that goomph needs
    addPeerClasses.accept(JavaExecable.class);
    // add the gradle API
    addPeerClasses.accept(JavaExec.class);

    return new SimpleFileCollection(files);
}
项目:Pushjet-Android    文件:IncrementalCompilationInitializer.java   
public void initializeCompilation(JavaCompileSpec spec,Collection<String> staleClasses) {
    if (staleClasses.isEmpty()) {
        spec.setSource(new SimpleFileCollection());
        return; //do nothing. No classes need recompilation.
    }

    PatternSet classesToDelete = new PatternSet();
    PatternSet sourcetoCompile = new PatternSet();

    preparePatterns(staleClasses,asList(spec.getDestinationDir())));
    //get rid of stale files
    filetree deleteMe = fileOperations.filetree(spec.getDestinationDir()).matching(classesToDelete);
    fileOperations.delete(deleteMe);
}
项目:Reer    文件:JavaInstallationProbe.java   
private EnumMap<SysProp,String> getMetadataInternal(File jdkPath) {
    JavaExecAction exec = factory.newJavaExecAction();
    exec.executable(javaExe(jdkPath,"java"));
    File workingDir = Files.createTempDir();
    exec.setWorkingDir(workingDir);
    exec.setClasspath(new SimpleFileCollection(workingDir));
    try {
        writeProbe(workingDir);
        exec.setMain(JavaProbe.CLASSNAME);
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        exec.setStandardOutput(baos);
        ByteArrayOutputStream errorOutput = new ByteArrayOutputStream();
        exec.setErrorOutput(errorOutput);
        exec.setIgnoreExitValue(true);
        ExecResult result = exec.execute();
        int exitValue = result.getExitValue();
        if (exitValue == 0) {
            return parseExecOutput(baos.toString());
        }
        return error("Command returned unexpected result code: " + exitValue + "\nError output:\n" + errorOutput);
    } catch (ExecException ex) {
        return error(ex.getMessage());
    } finally {
        try {
            FileUtils.deleteDirectory(workingDir);
        } catch (IOException e) {
            throw new GradleException("Unable to delete temp directory",e);
        }
    }
}
项目:Reer    文件:normalizingJavaCompiler.java   
private void resolveAndFilterSourceFiles(JavaCompileSpec spec) {
    // this mimics the behavior of the Ant javac task (and therefore AntJavaCompiler),// which silently excludes files not ending in .java
    FileCollection javaOnly = spec.getSource().filter(new Spec<File>() {
        public boolean isSatisfiedBy(File element) {
            return hasExtension(element,".java");
        }
    });

    spec.setSource(new SimpleFileCollection(javaOnly.getFiles()));
}
项目:Reer    文件:PlayPluginConfigurations.java   
@Override
public FileCollectionInternal createDelegate() {
    ImmutableSet.Builder<File> files = ImmutableSet.builder();
    for (ResolvedArtifact artifact : configuration.getResolvedConfiguration().getResolvedArtifacts()) {
        if ((artifact.getId().getComponentIdentifier() instanceof ProjectComponentIdentifier) == matchProjectComponents) {
            files.add(artifact.getFile());
        }
    }
    return new SimpleFileCollection(files.build());
}
项目:Pushjet-Android    文件:normalizingGroovyCompiler.java   
private void resolveAndFilterSourceFiles(final GroovyJavaJointCompileSpec spec) {
    FileCollection filtered = spec.getSource().filter(new Spec<File>() {
        public boolean isSatisfiedBy(File element) {
            for (String fileExtension : spec.getGroovyCompileOptions().getFileExtensions()) {
                if (element.getName().endsWith("." + fileExtension)) {
                    return true;
                }
            }
            return false;
        }
    });

    spec.setSource(new SimpleFileCollection(filtered.getFiles()));
}
项目:Pushjet-Android    文件:normalizingJavaCompiler.java   
private void resolveAndFilterSourceFiles(JavaCompileSpec spec) {
    // this mimics the behavior of the Ant javac task (and therefore AntJavaCompiler),// which silently excludes files not ending in .java
    FileCollection javaOnly = spec.getSource().filter(new Spec<File>() {
        public boolean isSatisfiedBy(File element) {
            return element.getName().endsWith(".java");
        }
    });

    spec.setSource(new SimpleFileCollection(javaOnly.getFiles()));
}
项目:Pushjet-Android    文件:DefaultFileCollectionSnapshotter.java   
public FileCollection getFiles() {
    List<File> files = new ArrayList<File>();
    for (Map.Entry<String,IncrementalFileSnapshot> entry : snapshots.entrySet()) {
        if (entry.getValue() instanceof filehashSnapshot) {
            files.add(new File(entry.getKey()));
        }
    }
    return new SimpleFileCollection(files);
}
项目:Pushjet-Android    文件:normalizingScalaCompiler.java   
private void resolveClasspath(ScalaJavaJointCompileSpec spec) {
    spec.setClasspath(new SimpleFileCollection(Lists.newArrayList(spec.getClasspath())));
    spec.setScalaClasspath(new SimpleFileCollection(Lists.newArrayList(spec.getScalaClasspath())));
    spec.setZincclasspath(new SimpleFileCollection(Lists.newArrayList(spec.getZincclasspath())));

    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug("Class path: {}",spec.getClasspath());
        LOGGER.debug("Scala class path: {}",spec.getScalaClasspath());
        LOGGER.debug("Zinc class path: {}",spec.getZincclasspath());
    }
}
项目:Pushjet-Android    文件:DefaultFileCollectionSnapshotter.java   
public FileCollection getFiles() {
    List<File> files = new ArrayList<File>();
    for (Map.Entry<String,FileSnapshot> entry : snapshots.entrySet()) {
        if (entry.getValue() instanceof filehashSnapshot) {
            files.add(new File(entry.getKey()));
        }
    }
    return new SimpleFileCollection(files);
}
项目:Pushjet-Android    文件:SelectiveCompilation.java   
public SelectiveCompilation(IncrementalTaskInputs inputs,filetree source,FileCollection compileClasspath,final File compileDestination,final ClassDependencyInfoSerializer dependencyInfoSerializer,final JarSnapshotCache jarSnapshotCache,final SelectiveJavaCompiler compiler,Iterable<File> sourceDirs,final FileOperations operations) {
    this.operations = operations;
    this.jarSnapshotFeeder = new JarSnapshotFeeder(jarSnapshotCache,new JarSnapshotter(new DefaultHasher()));
    this.compiler = compiler;

    Clock clock = new Clock();
    final InputOutputMapper mapper = new InputOutputMapper(sourceDirs,compileDestination);

    //load dependency info
    final ClassDependencyInfo dependencyInfo = dependencyInfoSerializer.readInfo();

    //including only source java classes that were changed
    final PatternSet changedSourceOnly = new PatternSet();
    InputFileDetailsAction action = new InputFileDetailsAction(mapper,compiler,changedSourceOnly,dependencyInfo);
    inputs.outOfDate(action);
    inputs.removed(action);
    if (fullRebuildNeeded != null) {
        LOG.lifecycle("Stale classes detection completed in {}. Rebuild needed: {}.",clock.getTime(),fullRebuildNeeded);
        this.classpath = compileClasspath;
        this.source = source;
        return;
    }

    compiler.deleteStaleClasses();
    Set<File> filesToCompile = source.matching(changedSourceOnly).getFiles();
    if (filesToCompile.isEmpty()) {
        this.compilationNeeded = false;
        this.classpath = compileClasspath;
        this.source = source;
    } else {
        this.classpath = compileClasspath.plus(new SimpleFileCollection(compileDestination));
        this.source = source.matching(changedSourceOnly);
    }
    LOG.lifecycle("Stale classes detection completed in {}. Compile include patterns: {}.",changedSourceOnly.getIncludes());
}
项目:CodeColors    文件:IgnoreResFilesTaskActionWrapper.java   
@Override
public FileCollection getoutputFiles() {
    ArrayList<File> newOuputFiles = new ArrayList<>();
    for (File file : mTaskExecutionHistory.getoutputFiles()) {
        newOuputFiles.add(
                FileUtils.inFolder(file,mResFiles) ?
                        new IgnoreResFileFile(file.getPath(),mResFiles) : file);
    }
    return new SimpleFileCollection(newOuputFiles);
}
项目:checkstyle-addons    文件:DependencyConfigs.java   
private FileCollection readlistofDepConfigs(@Nonnull final File pDepConfigDir)
{
    File[] listofFiles = pDepConfigDir.listFiles(new PropertyFileFilter());
    if (listofFiles == null) {
        throw new GradleException("no dependency configurations found in dir: " + pDepConfigDir);
    }
    return new SimpleFileCollection(listofFiles);
}
项目:Reer    文件:SourceSetNativeDependencyResolver.java   
private FileCollection empty() {
    return new SimpleFileCollection();
}
项目:Reer    文件:EmptyClasspath.java   
@Override
public FileCollection getFiles() {
    return new SimpleFileCollection();
}
项目:Reer    文件:normalizingJavaCompiler.java   
private void resolveClasspath(JavaCompileSpec spec) {
    spec.setClasspath(new SimpleFileCollection(Lists.newArrayList(spec.getClasspath())));
}
项目:Reer    文件:normalizingScalaCompiler.java   
private void resolveAndFilterSourceFiles(final ScalaJavaJointCompileSpec spec) {
    spec.setSource(new SimpleFileCollection(spec.getSource().getFiles()));
}
项目:Reer    文件:CacheableTaskOutputCompositeFilePropertyElementSpec.java   
public CacheableTaskOutputCompositeFilePropertyElementSpec(CompositeTaskOutputPropertySpec parentProperty,String propertySuffix,File file) {
    this.parentProperty = parentProperty;
    this.propertySuffix = propertySuffix;
    this.files = new SimpleFileCollection(Collections.singleton(file));
    this.file = file;
}
项目:Reer    文件:PlayTestPlugin.java   
@Mutate
void createTestTasks(ModelMap<Task> tasks,@Path("binaries") ModelMap<PlayApplicationBinarySpecInternal> playBinaries,final PlayPluginConfigurations configurations,final FileResolver fileResolver,final ProjectIdentifier projectIdentifier,@Path("buildDir") final File buildDir) {
    for (final PlayApplicationBinarySpecInternal binary : playBinaries) {
        final PlayToolProvider playToolProvider = binary.getToolChain().select(binary.getTargetPlatform());
        final FileCollection testCompileClasspath = getTestCompileClasspath(binary,playToolProvider,configurations);

        final String testCompileTaskName = binary.getTasks().taskName("compile","tests");
        final File testSourceDir = fileResolver.resolve("test");
        final FileCollection testSources = new SimpleFileCollection(testSourceDir).getAsfiletree().matching(new PatternSet().include("**/*.scala","**/*.java"));
        final File testClassesDir = new File(buildDir,binary.getProjectScopedname() + "/testClasses");
        tasks.create(testCompileTaskName,PlatformScalaCompile.class,new Action<PlatformScalaCompile>() {
            public void execute(PlatformScalaCompile scalaCompile) {
                scalaCompile.setDescription("Compiles the scala and java test sources for the " + binary.getdisplayName() + ".");

                scalaCompile.setClasspath(testCompileClasspath);

                scalaCompile.dependsOn(binary.getBuildTask());
                scalaCompile.setPlatform(binary.getTargetPlatform().getScalaPlatform());
                scalaCompile.setDestinationDir(testClassesDir);
                scalaCompile.setSource(testSources);
                String targetCompatibility = binary.getTargetPlatform().getJavaPlatform().getTargetCompatibility().getMajorVersion();
                scalaCompile.setSourceCompatibility(targetCompatibility);
                scalaCompile.setTargetCompatibility(targetCompatibility);

                IncrementalCompileOptions incrementalOptions = scalaCompile.getScalaCompileOptions().getIncrementalOptions();
                incrementalOptions.setAnalysisFile(new File(buildDir,"tmp/scala/compilerAnalysis/" + testCompileTaskName + ".analysis"));
            }
        });

        final String testTaskName = binary.getTasks().taskName("test");
        final File binaryBuildDir = new File(buildDir,binary.getProjectScopedname());
        tasks.create(testTaskName,Test.class,new Action<Test>() {
            public void execute(Test test) {
                test.setDescription("Runs " + WordUtils.uncapitalize(binary.getdisplayName() + "."));

                test.setClasspath(getRuntimeClasspath(testClassesDir,testCompileClasspath));

                test.setTestClassesDir(testClassesDir);
                test.setBinResultsDir(new File(binaryBuildDir,"results/" + testTaskName + "/bin"));
                test.getReports().getJunitXml().setDestination(new File(binaryBuildDir,"reports/test/xml"));
                test.getReports().getHtml().setDestination(new File(binaryBuildDir,"reports/test"));
                test.dependsOn(testCompileTaskName);
                test.setWorkingDir(projectIdentifier.getProjectDir());
            }
        });
        binary.getTasks().add(tasks.get(testTaskName));
    }
}
项目:Reer    文件:PlayTestPlugin.java   
private FileCollection getTestCompileClasspath(PlayApplicationBinarySpec binary,PlayToolProvider playToolProvider,PlayPluginConfigurations configurations) {
    return new SimpleFileCollection(binary.getJarFile()).plus(configurations.getPlaytest().getAllArtifacts());
}
项目:Reer    文件:PlayTestPlugin.java   
private FileCollection getRuntimeClasspath(File testClassesDir,FileCollection testCompileClasspath) {
    return new SimpleFileCollection(testClassesDir).plus(testCompileClasspath);
}
项目:Reer    文件:Signoperation.java   
private FileCollection newSignatureFileCollection(Function<Signature,File> getFile) {
    return new SimpleFileCollection(collectSignatureFiles(getFile));
}
项目:Pushjet-Android    文件:normalizingScalaCompiler.java   
private void resolveAndFilterSourceFiles(final ScalaJavaJointCompileSpec spec) {
    spec.setSource(new SimpleFileCollection(spec.getSource().getFiles()));
}
项目:Pushjet-Android    文件:SourceSetNativeDependencyResolver.java   
private FileCollection empty() {
    return new SimpleFileCollection();
}
项目:Pushjet-Android    文件:ApiRequirementNativeDependencyResolver.java   
public FileCollection getLinkFiles() {
    return new SimpleFileCollection();
}
项目:Pushjet-Android    文件:ApiRequirementNativeDependencyResolver.java   
public FileCollection getRuntimeFiles() {
    return new SimpleFileCollection();
}
项目:Pushjet-Android    文件:DefaultStaticLibraryBinarySpec.java   
public FileCollection getRuntimeFiles() {
    return new SimpleFileCollection();
}
项目:Pushjet-Android    文件:AbstractPrebuiltLibraryBinary.java   
public FileCollection getHeaderDirs() {
    return new SimpleFileCollection(library.getHeaders().getSrcDirs());
}
项目:Pushjet-Android    文件:DefaultPrebuiltStaticLibraryBinary.java   
public FileCollection getRuntimeFiles() {
    return new SimpleFileCollection();
}
项目:Pushjet-Android    文件:JavaCompilerArgumentsBuilder.java   
private FileCollection toFileCollection(Iterable<File> classpath) {
    if (classpath instanceof FileCollection) {
        return (FileCollection) classpath;
    }
    return new SimpleFileCollection(Lists.newArrayList(classpath));
}
项目:Pushjet-Android    文件:normalizingJavaCompiler.java   
private void resolveClasspath(JavaCompileSpec spec) {
    spec.setClasspath(new SimpleFileCollection(Lists.newArrayList(spec.getClasspath())));
}
项目:Pushjet-Android    文件:DefaultJavaSourceSet.java   
public FileCollection getFiles() {
    return new SimpleFileCollection();
}
项目:Pushjet-Android    文件:DefaultTaskArtifactStateRepository.java   
public FileCollection getoutputFiles() {
    TaskExecution lastExecution = history.getPrevIoUsExecution();
    return lastExecution != null && lastExecution.getoutputFilesSnapshot() != null ? lastExecution.getoutputFilesSnapshot().getFiles() : new SimpleFileCollection();
}

我们今天的关于在PyInstaller中将.onefile与.spec一起使用pyinstaller an integer is的分享已经告一段落,感谢您的关注,如果您想了解更多关于【解决】MacOS 下 Python3.7 使用 pyinstaller 打包后执行报错 Failed to execute script pyi_rth__tkinter、asp.net-mvc – 在ControllerInstanceFilterProvider的Filters之前运行的GlobalFilterCollection的过滤器、org.gradle.api.internal.file.collections.DefaultConfigurableFileCollection的实例源码、org.gradle.api.internal.file.collections.SimpleFileCollection的实例源码的相关信息,请在本站查询。

本文标签: